Module org.apache.lucene.core
Package org.apache.lucene.store
Class ByteBufferIndexInput.MultiBufferImpl
java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.lucene.store.ByteBufferIndexInput
org.apache.lucene.store.ByteBufferIndexInput.MultiBufferImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable,RandomAccessInput
- Enclosing class:
ByteBufferIndexInput
This class adds offset support to ByteBufferIndexInput, which is needed for slices.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.store.ByteBufferIndexInput
ByteBufferIndexInput.MultiBufferImpl, ByteBufferIndexInput.SingleBufferImpl -
Field Summary
FieldsFields inherited from class org.apache.lucene.store.ByteBufferIndexInput
buffers, chunkSizeMask, chunkSizePower, curBuf, curBufIndex, guard, isClone, length -
Constructor Summary
ConstructorsConstructorDescriptionMultiBufferImpl(String resourceDescription, ByteBuffer[] buffers, int offset, long length, int chunkSizePower, ByteBufferGuard guard) -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteBufferIndexInputbuildSlice(String sliceDescription, long ofs, long length) Builds the actual sliced IndexInput (may apply extra offset in subclasses).longReturns the current position in this file, where the next read will occur.(package private) RuntimeExceptionhandlePositionalIOOBE(RuntimeException unused, String action, long pos) bytereadByte(long pos) Reads a byte at the given position in the fileintreadInt(long pos) Reads an integer (LE byte order) at the given position in the filelongreadLong(long pos) Reads a long (LE byte order) at the given position in the fileshortreadShort(long pos) Reads a short (LE byte order) at the given position in the filevoidseek(long pos) Sets current position in this file, where the next read will occur.Methods inherited from class org.apache.lucene.store.ByteBufferIndexInput
alreadyClosed, clone, close, length, newCloneInstance, newInstance, readByte, readBytes, readFloats, readInt, readInts, readLong, readLongs, readShort, readVInt, readVLong, setCurBuf, sliceMethods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, randomAccessSlice, skipBytes, toStringMethods inherited from class org.apache.lucene.store.DataInput
readBytes, readGroupVInt, readGroupVInts, readMapOfStrings, readSetOfStrings, readString, readZInt, readZLong
-
Field Details
-
offset
private final int offset
-
-
Constructor Details
-
MultiBufferImpl
MultiBufferImpl(String resourceDescription, ByteBuffer[] buffers, int offset, long length, int chunkSizePower, ByteBufferGuard guard)
-
-
Method Details
-
handlePositionalIOOBE
RuntimeException handlePositionalIOOBE(RuntimeException unused, String action, long pos) throws IOException - Overrides:
handlePositionalIOOBEin classByteBufferIndexInput- Throws:
IOException
-
seek
Description copied from class:IndexInputSets current position in this file, where the next read will occur. If this is beyond the end of the file then this will throwEOFExceptionand then the stream is in an undetermined state.- Overrides:
seekin classByteBufferIndexInput- Throws:
IOException- See Also:
-
getFilePointer
public long getFilePointer()Description copied from class:IndexInputReturns the current position in this file, where the next read will occur.- Overrides:
getFilePointerin classByteBufferIndexInput- See Also:
-
readByte
Description copied from interface:RandomAccessInputReads a byte at the given position in the file- Specified by:
readBytein interfaceRandomAccessInput- Overrides:
readBytein classByteBufferIndexInput- Throws:
IOException- See Also:
-
readShort
Description copied from interface:RandomAccessInputReads a short (LE byte order) at the given position in the file- Specified by:
readShortin interfaceRandomAccessInput- Overrides:
readShortin classByteBufferIndexInput- Throws:
IOException- See Also:
-
readInt
Description copied from interface:RandomAccessInputReads an integer (LE byte order) at the given position in the file- Specified by:
readIntin interfaceRandomAccessInput- Overrides:
readIntin classByteBufferIndexInput- Throws:
IOException- See Also:
-
readLong
Description copied from interface:RandomAccessInputReads a long (LE byte order) at the given position in the file- Specified by:
readLongin interfaceRandomAccessInput- Overrides:
readLongin classByteBufferIndexInput- Throws:
IOException- See Also:
-
buildSlice
Description copied from class:ByteBufferIndexInputBuilds the actual sliced IndexInput (may apply extra offset in subclasses). *- Overrides:
buildSlicein classByteBufferIndexInput
-