public static final class PagedBytes.Reader extends java.lang.Object implements Accountable
PagedBytes.freeze(boolean)
Modifier and Type | Field and Description |
---|---|
private static long |
BASE_RAM_BYTES_USED |
private int |
blockBits |
private int |
blockMask |
private byte[][] |
blocks |
private int |
blockSize |
private long |
bytesUsedPerBlock |
Modifier | Constructor and Description |
---|---|
private |
Reader(PagedBytes pagedBytes) |
Modifier and Type | Method and Description |
---|---|
void |
fill(BytesRef b,
long start)
Reads length as 1 or 2 byte vInt prefix, starting at start.
|
void |
fillSlice(BytesRef b,
long start,
int length)
Gets a slice out of
PagedBytes starting at start with a
given length. |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildResources
private static final long BASE_RAM_BYTES_USED
private final byte[][] blocks
private final int blockBits
private final int blockMask
private final int blockSize
private final long bytesUsedPerBlock
private Reader(PagedBytes pagedBytes)
public void 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 two blocks are not supported.
public void fill(BytesRef b, long start)
Note: this method does not support slices spanning across block borders.
public long ramBytesUsed()
Accountable
ramBytesUsed
in interface Accountable
public java.lang.String toString()
toString
in class java.lang.Object