Package org.apache.lucene.util.packed
Class BlockPackedReaderIterator
- java.lang.Object
-
- org.apache.lucene.util.packed.BlockPackedReaderIterator
-
public final class BlockPackedReaderIterator extends java.lang.Object
Reader for sequences of longs written withBlockPackedWriter
.- See Also:
BlockPackedWriter
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]
blocks
(package private) int
blockSize
(package private) DataInput
in
(package private) int
off
(package private) long
ord
(package private) int
packedIntsVersion
(package private) long
valueCount
(package private) long[]
values
(package private) LongsRef
valuesRef
-
Constructor Summary
Constructors Constructor Description BlockPackedReaderIterator(DataInput in, int packedIntsVersion, int blockSize, long valueCount)
Sole constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
next()
Read the next value.LongsRef
next(int count)
Read between1
andcount
values.long
ord()
Return the offset of the next value to read.(package private) static long
readVLong(DataInput in)
private void
refill()
void
reset(DataInput in, long valueCount)
Reset the current reader to wrap a stream ofvalueCount
values contained inin
.void
skip(long count)
Skip exactlycount
values.private void
skipBytes(long count)
-
-
-
Constructor Detail
-
BlockPackedReaderIterator
public BlockPackedReaderIterator(DataInput in, int packedIntsVersion, int blockSize, long valueCount)
Sole constructor.- Parameters:
blockSize
- the number of values of a block, must be equal to the block size of theBlockPackedWriter
which has been used to write the stream
-
-
Method Detail
-
readVLong
static long readVLong(DataInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
reset
public void reset(DataInput in, long valueCount)
Reset the current reader to wrap a stream ofvalueCount
values contained inin
. The block size remains unchanged.
-
skip
public void skip(long count) throws java.io.IOException
Skip exactlycount
values.- Throws:
java.io.IOException
-
skipBytes
private void skipBytes(long count) throws java.io.IOException
- Throws:
java.io.IOException
-
next
public long next() throws java.io.IOException
Read the next value.- Throws:
java.io.IOException
-
next
public LongsRef next(int count) throws java.io.IOException
Read between1
andcount
values.- Throws:
java.io.IOException
-
refill
private void refill() throws java.io.IOException
- Throws:
java.io.IOException
-
ord
public long ord()
Return the offset of the next value to read.
-
-