/** Skips to the next block, closing this segmented input stream if there are no more blocks. */ public void close() throws IOException { ensureBlocksNotEmpty(); if ( closed ) return; if ( hasMoreBlocks() ) { nextBlock(); return; } if ( DEBUG ) LOGGER.debug( "Closing the underlying input stream of this segmented input stream" ); closed = true; in.close(); }
/** Skips to the next block, closing this segmented input stream if there are no more blocks. */ @Override public void close() throws IOException { ensureBlocksNotEmpty(); if (closed) return; if (hasMoreBlocks()) { nextBlock(); return; } if (DEBUG) LOGGER.debug("Closing the underlying input stream of this segmented input stream"); closed = true; in.close(); }
/** Skips to the next block, closing this segmented input stream if there are no more blocks. */ public void close() throws IOException { ensureBlocksNotEmpty(); if ( closed ) return; if ( hasMoreBlocks() ) { nextBlock(); return; } if ( DEBUG ) LOGGER.debug( "Closing the underlying input stream of this segmented input stream" ); closed = true; in.close(); }
/** Adds a new block defined by its array of segment delimiters. * * <p>The block has length defined by the difference between the last and first * delimiter. * * <p>This method performs the initial call to {@link #nextBlock()} when the first marker * is put in. * * @param delimiter a list of segment delimiters. * @throws IllegalArgumentException if the elements of <code>delimiter</code> are negative or not increasing. */ public void addBlock( final long... delimiter ) throws IllegalArgumentException, IOException { ensureNotClosed(); blocks.add( new SegmentBlock( delimiter ) ); if ( DEBUG ) LOGGER.debug( "Adding a new block with delimiters " + Arrays.toString( delimiter ) ); if ( currentBlock == -1 ) nextBlock(); }
/** Adds a new block defined by its array of segment delimiters. * * <p>The block has length defined by the difference between the last and first * delimiter. * * <p>This method performs the initial call to {@link #nextBlock()} when the first marker * is put in. * * @param delimiter a list of segment delimiters. * @throws IllegalArgumentException if the elements of <code>delimiter</code> are negative or not increasing. */ public void addBlock( final long... delimiter ) throws IllegalArgumentException, IOException { ensureNotClosed(); blocks.add( new SegmentBlock( delimiter ) ); if ( DEBUG ) LOGGER.debug( "Adding a new block with delimiters " + Arrays.toString( delimiter ) ); if ( currentBlock == -1 ) nextBlock(); }
/** Adds a new block defined by its array of segment delimiters. * * <p>The block has length defined by the difference between the last and first * delimiter. * * <p>This method performs the initial call to {@link #nextBlock()} when the first marker * is put in. * * @param delimiter a list of segment delimiters. * @throws IllegalArgumentException if the elements of <code>delimiter</code> are negative or not increasing. */ public void addBlock(final long... delimiter) throws IllegalArgumentException, IOException { ensureNotClosed(); blocks.add(new SegmentBlock(delimiter)); if (DEBUG) LOGGER.debug("Adding a new block with delimiters " + Arrays.toString(delimiter)); if (currentBlock == -1) nextBlock(); }
public Document nextDocument() throws IOException { /* If necessary, skip to the next segment, else, try skipping to the next gzip file. */ if ( DEBUG ) LOGGER.debug( "nextDocument() has been called " ); if ( last != null ) { last.close(); if ( ! siStream.hasMoreBlocks() ) { if ( ! nextFile() ) return last = null; } else siStream.nextBlock(); } else if ( ! nextFile() ) return null; // First call return last = factory.getDocument( siStream, metadata( currentDocument++ ) ); }
public Document nextDocument() throws IOException { /* If necessary, skip to the next segment, else, try skipping to the next gzip file. */ if ( DEBUG ) LOGGER.debug( "nextDocument() has been called " ); if ( last != null ) { last.close(); if ( ! siStream.hasMoreBlocks() ) { if ( ! nextFile() ) return last = null; } else siStream.nextBlock(); } else if ( ! nextFile() ) return null; // First call return last = factory.getDocument( siStream, metadata( currentDocument++ ) ); }
public Document nextDocument() throws IOException { /* If necessary, skip to the next segment, else, try skipping to the next gzip file. */ if ( DEBUG ) LOGGER.debug( "nextDocument() has been called " ); if ( last != null ) { last.close(); if ( ! siStream.hasMoreBlocks() ) { if ( ! nextFile() ) return last = null; } else siStream.nextBlock(); } else if ( ! nextFile() ) return null; // First call return last = factory.getDocument( siStream, metadata( currentDocument++ ) ); }
public Document nextDocument() throws IOException { /* If necessary, skip to the next segment, else, try skipping to the next gzip file. */ if ( DEBUG ) LOGGER.debug( "nextDocument() has been called " ); if ( last != null ) { last.close(); if ( ! siStream.hasMoreBlocks() ) { if ( ! nextFile() ) return last = null; } else siStream.nextBlock(); } else if ( ! nextFile() ) return null; // First call return last = factory.getDocument( siStream, metadata( currentDocument++ ) ); }