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 TypeMethodDescriptionlong
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 Details
-
SingleBufferImpl
SingleBufferImpl(String resourceDescription, ByteBuffer buffer, long length, int chunkSizePower, ByteBufferGuard guard)
-
-
Method Details
-
seek
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:
IOException
- See Also:
-
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:
-
readByte
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:
IOException
- See Also:
-
readShort
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:
IOException
- See Also:
-
readInt
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:
IOException
- See Also:
-
readLong
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:
IOException
- See Also:
-