PagedGrowableWriter

A PagedGrowableWriter. This class slices data into fixed-size blocks which have independent numbers of bits per value and grow on-demand.

You should use this class instead of the PackedLongValues related ones only when you need random write-access. Otherwise this class will likely be slower and less memory-efficient.

Constructors

Link copied to clipboard
constructor(size: Long, pageSize: Int, startBitsPerValue: Int, acceptableOverheadRatio: Float)

Create a new PagedGrowableWriter instance.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val size: Long
Link copied to clipboard

Functions

Link copied to clipboard
open override fun get(index: Long): Long

Get value at index.

Link copied to clipboard
fun grow(minSize: Long = size() + 1): PagedGrowableWriter

Similar to ArrayUtil.grow.

Link copied to clipboard
fun indexInPage(index: Long): Int
Link copied to clipboard
fun lastPageSize(size: Long): Int
Link copied to clipboard
fun pageIndex(index: Long): Int
Link copied to clipboard
fun pageSize(): Int
Link copied to clipboard
open override fun ramBytesUsed(): Long

Return the memory usage of this object in bytes. Negative values are illegal.

Link copied to clipboard

Create a new copy of size newSize based on the content of this buffer. This method is much more efficient than creating a new instance and copying values one by one.

Link copied to clipboard
fun set(index: Long, value: Long)

Set value at index.

Link copied to clipboard
fun size(): Long

The number of values.

Link copied to clipboard
open override fun toString(): String