Module org.apache.lucene.core
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:
Closeable,AutoCloseable,Cloneable,RandomAccessInput
- Enclosing class:
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
ConstructorsConstructorDescriptionSingleBufferImpl(String resourceDescription, ByteBuffer buffer, long length, int chunkSizePower, ByteBufferGuard guard) -
Method Summary
Modifier and TypeMethodDescriptionlongReturns 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 (LE byte order) at the given position in the filelongreadLong(long pos) Reads a long (LE byte order) at the given position in the fileshortreadShort(long pos) Reads a short (LE byte order) 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
alreadyClosed, buildSlice, clone, close, handlePositionalIOOBE, length, newCloneInstance, newInstance, readByte, readBytes, readFloats, readInt, readInts, readLong, readLongs, readShort, readVInt, readVLong, setCurBuf, sliceMethods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, randomAccessSlice, skipBytes, toStringMethods inherited from class org.apache.lucene.store.DataInput
readBytes, readGroupVInt, readGroupVInts, readMapOfStrings, readSetOfStrings, readString, readZInt, readZLong
-
Constructor Details
-
SingleBufferImpl
SingleBufferImpl(String resourceDescription, ByteBuffer buffer, long length, int chunkSizePower, ByteBufferGuard guard)
-
-
Method Details
-
seek
Description 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:
IOException- See Also:
-
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:
-
readByte
Description copied from interface:RandomAccessInputReads a byte at the given position in the file- Specified by:
readBytein interfaceRandomAccessInput- Overrides:
readBytein classByteBufferIndexInput- Throws:
IOException- See Also:
-
readShort
Description copied from interface:RandomAccessInputReads a short (LE byte order) at the given position in the file- Specified by:
readShortin interfaceRandomAccessInput- Overrides:
readShortin classByteBufferIndexInput- Throws:
IOException- See Also:
-
readInt
Description copied from interface:RandomAccessInputReads an integer (LE byte order) at the given position in the file- Specified by:
readIntin interfaceRandomAccessInput- Overrides:
readIntin classByteBufferIndexInput- Throws:
IOException- See Also:
-
readLong
Description copied from interface:RandomAccessInputReads a long (LE byte order) at the given position in the file- Specified by:
readLongin interfaceRandomAccessInput- Overrides:
readLongin classByteBufferIndexInput- Throws:
IOException- See Also:
-