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 int
offset
-
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 ByteBufferIndexInput
buildSlice(java.lang.String sliceDescription, long ofs, long length)
Builds the actual sliced IndexInput (may apply extra offset in subclasses).long
getFilePointer()
Returns the current position in this file, where the next read will occur.byte
readByte(long pos)
Reads a byte at the given position in the fileint
readInt(long pos)
Reads an integer at the given position in the filelong
readLong(long pos)
Reads a long at the given position in the fileshort
readShort(long pos)
Reads a short 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
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.IOException
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:
java.io.IOException
- See Also:
IndexInput.getFilePointer()
-
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:
IndexInput.seek(long)
-
readByte
public byte readByte(long pos) throws java.io.IOException
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:
java.io.IOException
- See Also:
DataInput.readByte()
-
readShort
public short readShort(long pos) throws java.io.IOException
Description copied from interface:RandomAccessInput
Reads a short at the given position in the file- Specified by:
readShort
in interfaceRandomAccessInput
- Overrides:
readShort
in classByteBufferIndexInput
- Throws:
java.io.IOException
- See Also:
DataInput.readShort()
-
readInt
public int readInt(long pos) throws java.io.IOException
Description copied from interface:RandomAccessInput
Reads an integer at the given position in the file- Specified by:
readInt
in interfaceRandomAccessInput
- Overrides:
readInt
in classByteBufferIndexInput
- Throws:
java.io.IOException
- See Also:
DataInput.readInt()
-
readLong
public long readLong(long pos) throws java.io.IOException
Description copied from interface:RandomAccessInput
Reads a long at the given position in the file- Specified by:
readLong
in interfaceRandomAccessInput
- Overrides:
readLong
in 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:ByteBufferIndexInput
Builds the actual sliced IndexInput (may apply extra offset in subclasses).- Overrides:
buildSlice
in classByteBufferIndexInput
-
-