- java.lang.Object
-
- org.apache.lucene.store.DataInput
-
- org.apache.lucene.index.ByteSliceReader
-
- All Implemented Interfaces:
java.lang.Cloneable
final class ByteSliceReader extends DataInput
IndexInput that knows how to read the byte slices written by Posting and PostingVector. We read the bytes in each slice until we hit the end of that slice at which point we read the forwarding address of the next slice and then jump to it.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]
buffer
int
bufferOffset
(package private) int
bufferUpto
int
endIndex
(package private) int
level
(package private) int
limit
(package private) ByteBlockPool
pool
int
upto
-
Constructor Summary
Constructors Constructor Description ByteSliceReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
eof()
void
init(ByteBlockPool pool, int startIndex, int endIndex)
void
nextSlice()
byte
readByte()
Reads and returns a single byte.void
readBytes(byte[] b, int offset, int len)
Reads a specified number of bytes into an array at the specified offset.void
skipBytes(long numBytes)
Skip overnumBytes
bytes.long
writeTo(DataOutput out)
-
Methods inherited from class org.apache.lucene.store.DataInput
clone, readBytes, readFloats, readInt, readInts, readLong, readLongs, readMapOfStrings, readSetOfStrings, readShort, readString, readVInt, readVLong, readZInt, readZLong
-
-
-
-
Field Detail
-
pool
ByteBlockPool pool
-
bufferUpto
int bufferUpto
-
buffer
byte[] buffer
-
upto
public int upto
-
limit
int limit
-
level
int level
-
bufferOffset
public int bufferOffset
-
endIndex
public int endIndex
-
-
Method Detail
-
init
public void init(ByteBlockPool pool, int startIndex, int endIndex)
-
eof
public boolean eof()
-
readByte
public byte readByte()
Description copied from class:DataInput
Reads and returns a single byte.- Specified by:
readByte
in classDataInput
- See Also:
DataOutput.writeByte(byte)
-
writeTo
public long writeTo(DataOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
nextSlice
public void nextSlice()
-
readBytes
public void readBytes(byte[] b, int offset, int len)
Description copied from class:DataInput
Reads a specified number of bytes into an array at the specified offset.- Specified by:
readBytes
in classDataInput
- Parameters:
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to read- See Also:
DataOutput.writeBytes(byte[],int)
-
skipBytes
public void skipBytes(long numBytes)
Description copied from class:DataInput
Skip overnumBytes
bytes. This method may skip bytes in whatever way is most optimal, and may not have the same behavior as reading the skipped bytes. In general, negativenumBytes
are not supported.
-
-