Class BufferedIndexInput.SlicedIndexInput

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Cloneable, RandomAccessInput
    Enclosing class:
    BufferedIndexInput

    private static final class BufferedIndexInput.SlicedIndexInput
    extends BufferedIndexInput
    Implementation of an IndexInput that reads from a portion of a file.
    • Field Detail

      • fileOffset

        long fileOffset
      • length

        long length
    • Constructor Detail

      • SlicedIndexInput

        SlicedIndexInput​(java.lang.String sliceDescription,
                         IndexInput base,
                         long offset,
                         long length)
    • Method Detail

      • clone

        public BufferedIndexInput.SlicedIndexInput clone()
        Description copied from class: IndexInput
        Returns a clone of this stream.

        Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.

        Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.

        Warning: Lucene never closes cloned IndexInputs, it will only call IndexInput.close() on the original object.

        If you access the cloned IndexInput after closing the original object, any readXXX methods will throw AlreadyClosedException.

        This method is NOT thread safe, so if the current IndexInput is being used by one thread while clone is called by another, disaster could strike.

        Overrides:
        clone in class BufferedIndexInput
      • readInternal

        protected void readInternal​(java.nio.ByteBuffer b)
                             throws java.io.IOException
        Description copied from class: BufferedIndexInput
        Expert: implements buffer refill. Reads bytes from the current position in the input.
        Specified by:
        readInternal in class BufferedIndexInput
        Parameters:
        b - the buffer to read bytes into
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Description copied from class: IndexInput
        Closes the stream to further operations.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class IndexInput
        Throws:
        java.io.IOException