Package org.apache.lucene.store
Class ByteBufferIndexInput.SingleBufferImpl
- java.lang.Object
-
- org.apache.lucene.store.DataInput
-
- org.apache.lucene.store.IndexInput
-
- org.apache.lucene.store.ByteBufferIndexInput
-
- org.apache.lucene.store.ByteBufferIndexInput.SingleBufferImpl
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
,RandomAccessInput
- Enclosing class:
- ByteBufferIndexInput
static final class ByteBufferIndexInput.SingleBufferImpl extends ByteBufferIndexInput
Optimization of ByteBufferIndexInput for when there is only one buffer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.store.ByteBufferIndexInput
ByteBufferIndexInput.MultiBufferImpl, ByteBufferIndexInput.SingleBufferImpl
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.store.ByteBufferIndexInput
buffers, chunkSizeMask, chunkSizePower, curBuf, curBufIndex, guard, isClone, length
-
-
Constructor Summary
Constructors Constructor Description SingleBufferImpl(java.lang.String resourceDescription, java.nio.ByteBuffer buffer, long length, int chunkSizePower, ByteBufferGuard guard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 (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
buildSlice, 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
-
-
-
-
Constructor Detail
-
SingleBufferImpl
SingleBufferImpl(java.lang.String resourceDescription, java.nio.ByteBuffer buffer, 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 (LE byte order) at the given position in the file- Specified by:
readShort
in interfaceRandomAccessInput
- Overrides:
readShort
in classByteBufferIndexInput
- Throws:
java.io.IOException
- See Also:
DataInput.readShort()
,BitUtil.VH_LE_SHORT
-
readInt
public int readInt(long pos) throws java.io.IOException
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:
java.io.IOException
- See Also:
DataInput.readInt()
,BitUtil.VH_LE_INT
-
readLong
public long readLong(long pos) throws java.io.IOException
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:
java.io.IOException
- See Also:
DataInput.readLong()
,BitUtil.VH_LE_LONG
-
-