/** * Increments the fidIndex by 1. Indicates that a feature was removed from the location. This is * intended to ensure that FIDs stay constant over time. Consider the following case of 5 * features. feature 1 has fid typename.0 feature 2 has fid typename.1 feature 3 has fid * typename.2 feature 4 has fid typename.3 feature 5 has fid typename.4 when feature 3 is * removed/deleted the following usage of the write should take place: next(); (move to feature * 1) next(); (move to feature 2) next(); (move to feature 3) remove();(delete feature 3) * next(); (move to feature 4) // optional write(); (write feature 4) next(); (move to feature * 5) write(); (write(feature 5) * * @throws IOException */ public void remove() throws IOException { if (current == -1) throw new IOException("Current fid index is null, next must be called before remove"); if (hasNext()) { removes++; current = -1; // reader.next(); } }
/** * Increments the fidIndex by 1. Indicates that a feature was removed from the location. This is * intended to ensure that FIDs stay constant over time. Consider the following case of 5 * features. feature 1 has fid typename.0 feature 2 has fid typename.1 feature 3 has fid * typename.2 feature 4 has fid typename.3 feature 5 has fid typename.4 when feature 3 is * removed/deleted the following usage of the write should take place: next(); (move to feature * 1) next(); (move to feature 2) next(); (move to feature 3) remove();(delete feature 3) * next(); (move to feature 4) // optional write(); (write feature 4) next(); (move to feature * 5) write(); (write(feature 5) * * @throws IOException */ public void remove() throws IOException { if (current == -1) throw new IOException("Current fid index is null, next must be called before remove"); if (hasNext()) { removes++; current = -1; // reader.next(); } }
/** * Increments the fidIndex by 1. Indicates that a feature was * removed from the location. This is intended to ensure that FIDs stay * constant over time. Consider the following case of 5 features. feature * 1 has fid typename.0 feature 2 has fid typename.1 feature 3 has fid * typename.2 feature 4 has fid typename.3 feature 5 has fid typename.4 * when feature 3 is removed/deleted the following usage of the write * should take place: next(); (move to feature 1) next(); (move to * feature 2) next(); (move to feature 3) remove();(delete feature 3) * next(); (move to feature 4) // optional write(); (write feature 4) * next(); (move to feature 5) write(); (write(feature 5) * * @throws IOException */ public void remove() throws IOException { if( current==-1 ) throw new IOException("Current fid index is null, next must be called before remove"); if (hasNext()) { removes++; current=-1; // reader.next(); } }
private void finishLastWrite() throws IOException { while( hasNext() ) next(); if (current != -1) write(); drain(); writeHeader(); }
private void finishLastWrite() throws IOException { while( hasNext() ) next(); if (current != -1) write(); drain(); writeHeader(); }
public void close() throws IOException { if (closed) { return; } try { while(hasNext()) next(); if( current!=-1 ) write(); drain(); writeHeader(); } finally { try{ if( writeBuffer!=null ){ if( writeBuffer instanceof MappedByteBuffer ){ NIOUtilities.clean(writeBuffer); } } if( channel.isOpen() ) channel.close(); streamLogger.close(); }finally{ reader.close(); } } closed = true; }