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 ByteBufferIndexInput
buildSlice
(String sliceDescription, long ofs, long length) Builds the actual sliced IndexInput (may apply extra offset in subclasses).long
Returns the current position in this file, where the next read will occur.(package private) RuntimeException
handlePositionalIOOBE
(RuntimeException unused, String action, long pos) byte
readByte
(long pos) Reads a byte at the given position in the fileint
readInt
(long pos) Reads an integer (LE byte order) at the given position in the filelong
readLong
(long pos) Reads a long (LE byte order) at the given position in the fileshort
readShort
(long pos) Reads a short (LE byte order) at the given position in the filevoid
seek
(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, setCurBuf, slice
Methods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, randomAccessSlice, skipBytes, toString
Methods inherited from class org.apache.lucene.store.DataInput
readBytes, readMapOfStrings, readSetOfStrings, readString, readVInt, readVLong, 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:
handlePositionalIOOBE
in classByteBufferIndexInput
- Throws:
IOException
-
seek
Description copied from class:IndexInput
Sets current position in this file, where the next read will occur. If this is beyond the end of the file then this will throwEOFException
and then the stream is in an undetermined state.- Overrides:
seek
in classByteBufferIndexInput
- Throws:
IOException
- See Also:
-
getFilePointer
public long getFilePointer()Description copied from class:IndexInput
Returns the current position in this file, where the next read will occur.- Overrides:
getFilePointer
in classByteBufferIndexInput
- See Also:
-
readByte
Description copied from interface:RandomAccessInput
Reads a byte at the given position in the file- Specified by:
readByte
in interfaceRandomAccessInput
- Overrides:
readByte
in classByteBufferIndexInput
- Throws:
IOException
- See Also:
-
readShort
Description copied from interface:RandomAccessInput
Reads a short (LE byte order) at the given position in the file- Specified by:
readShort
in interfaceRandomAccessInput
- Overrides:
readShort
in classByteBufferIndexInput
- Throws:
IOException
- See Also:
-
readInt
Description copied from interface:RandomAccessInput
Reads an integer (LE byte order) at the given position in the file- Specified by:
readInt
in interfaceRandomAccessInput
- Overrides:
readInt
in classByteBufferIndexInput
- Throws:
IOException
- See Also:
-
readLong
Description copied from interface:RandomAccessInput
Reads a long (LE byte order) at the given position in the file- Specified by:
readLong
in interfaceRandomAccessInput
- Overrides:
readLong
in classByteBufferIndexInput
- Throws:
IOException
- See Also:
-
buildSlice
Description copied from class:ByteBufferIndexInput
Builds the actual sliced IndexInput (may apply extra offset in subclasses). *- Overrides:
buildSlice
in classByteBufferIndexInput
-