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 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
buildSlice, 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
-
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.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()
-
-