public static final class PagedBytes.Reader extends Object
PagedBytes.freeze(boolean)
Constructor and Description |
---|
PagedBytes.Reader(PagedBytes pagedBytes) |
Modifier and Type | Method and Description |
---|---|
BytesRef |
fill(BytesRef b,
long start)
Reads length as 1 or 2 byte vInt prefix, starting at start.
|
int |
fillAndGetIndex(BytesRef b,
long start)
Reads length as 1 or 2 byte vInt prefix, starting at start. *
Note: this method does not support slices spanning across block
borders.
|
long |
fillAndGetStart(BytesRef b,
long start)
Reads length as 1 or 2 byte vInt prefix, starting at start and
returns the start offset of the next part, suitable as start parameter on
next call to sequentially read all
BytesRef . |
BytesRef |
fillSlice(BytesRef b,
long start,
int length)
Gets a slice out of
PagedBytes starting at start with a
given length. |
BytesRef |
fillSliceWithPrefix(BytesRef b,
long start)
Gets a slice out of
PagedBytes starting at start, the
length is read as 1 or 2 byte vInt prefix. |
int[] |
getBlockEnds() |
byte[][] |
getBlocks() |
public PagedBytes.Reader(PagedBytes pagedBytes)
public BytesRef fillSlice(BytesRef b, long start, int length)
PagedBytes
starting at start with a
given length. Iff the slice spans across a block border this method will
allocate sufficient resources and copy the paged data.
Slices spanning more than one block are not supported.
public BytesRef fill(BytesRef b, long start)
Note: this method does not support slices spanning across block borders.
BytesRef
public int fillAndGetIndex(BytesRef b, long start)
Note: this method does not support slices spanning across block borders.
public long fillAndGetStart(BytesRef b, long start)
BytesRef
.
Note: this method does not support slices spanning across block borders.
BytesRef
.public BytesRef fillSliceWithPrefix(BytesRef b, long start)
PagedBytes
starting at start, the
length is read as 1 or 2 byte vInt prefix. Iff the slice spans across a
block border this method will allocate sufficient resources and copy the
paged data.
Slices spanning more than one block are not supported.
public byte[][] getBlocks()
public int[] getBlockEnds()