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:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Cloneable,RandomAccessInput
- Enclosing class:
- ByteBufferIndexInput
static final class ByteBufferIndexInput.MultiBufferImpl extends 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
Fields Modifier and Type Field Description private intoffset-
Fields inherited from class org.apache.lucene.store.ByteBufferIndexInput
buffers, chunkSizeMask, chunkSizePower, curBuf, curBufIndex, guard, isClone, length
-
-
Constructor Summary
Constructors Constructor Description MultiBufferImpl(java.lang.String resourceDescription, java.nio.ByteBuffer[] buffers, int offset, long length, int chunkSizePower, ByteBufferGuard guard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ByteBufferIndexInputbuildSlice(java.lang.String sliceDescription, long ofs, long length)Builds the actual sliced IndexInput (may apply extra offset in subclasses).longgetFilePointer()Returns the current position in this file, where the next read will occur.bytereadByte(long pos)Reads a byte at the given position in the fileintreadInt(long pos)Reads an integer at the given position in the filelongreadLong(long pos)Reads a long at the given position in the fileshortreadShort(long pos)Reads a short 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
clone, close, length, newCloneInstance, newInstance, readByte, readBytes, readInt, readLELongs, readLong, readShort, setCurBuf, slice
-
Methods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, randomAccessSlice, toString
-
Methods inherited from class org.apache.lucene.store.DataInput
readBytes, readMapOfStrings, readSetOfStrings, readString, readVInt, readVLong, readZInt, readZLong, skipBytes
-
-
-
-
Constructor Detail
-
MultiBufferImpl
MultiBufferImpl(java.lang.String resourceDescription, java.nio.ByteBuffer[] buffers, int offset, long length, int chunkSizePower, ByteBufferGuard guard)
-
-
Method Detail
-
seek
public void seek(long pos) throws java.io.IOExceptionDescription 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:
java.io.IOException- See Also:
IndexInput.getFilePointer()
-
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:
IndexInput.seek(long)
-
readByte
public byte readByte(long pos) throws java.io.IOExceptionDescription copied from interface:RandomAccessInputReads a byte at the given position in the file- Specified by:
readBytein interfaceRandomAccessInput- Overrides:
readBytein classByteBufferIndexInput- Throws:
java.io.IOException- See Also:
DataInput.readByte()
-
readShort
public short readShort(long pos) throws java.io.IOExceptionDescription copied from interface:RandomAccessInputReads a short at the given position in the file- Specified by:
readShortin interfaceRandomAccessInput- Overrides:
readShortin classByteBufferIndexInput- Throws:
java.io.IOException- See Also:
DataInput.readShort()
-
readInt
public int readInt(long pos) throws java.io.IOExceptionDescription copied from interface:RandomAccessInputReads an integer at the given position in the file- Specified by:
readIntin interfaceRandomAccessInput- Overrides:
readIntin classByteBufferIndexInput- Throws:
java.io.IOException- See Also:
DataInput.readInt()
-
readLong
public long readLong(long pos) throws java.io.IOExceptionDescription copied from interface:RandomAccessInputReads a long at the given position in the file- Specified by:
readLongin interfaceRandomAccessInput- Overrides:
readLongin classByteBufferIndexInput- Throws:
java.io.IOException- See Also:
DataInput.readLong()
-
buildSlice
protected ByteBufferIndexInput buildSlice(java.lang.String sliceDescription, long ofs, long length)
Description copied from class:ByteBufferIndexInputBuilds the actual sliced IndexInput (may apply extra offset in subclasses).- Overrides:
buildSlicein classByteBufferIndexInput
-
-