PagedBytes

class PagedBytes(blockBits: Int) : Accountable

Represents a logical byte[] as a series of pages. You can write-once into the logical byte[] (append only), using copy, and then retrieve slices (BytesRef) into it using fill.

Constructors

Link copied to clipboard
constructor(blockBits: Int)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Input that transparently iterates over pages

Link copied to clipboard

Output that transparently spills to new pages as necessary

Link copied to clipboard
class Reader(pagedBytes: PagedBytes) : Accountable

Provides methods to read BytesRefs from a frozen PagedBytes.

Properties

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

Functions

Link copied to clipboard
fun copy(in: IndexInput, byteCount: Long)

Read this many bytes from in

fun copy(bytes: BytesRef, out: BytesRef)

Copy BytesRef in, setting BytesRef out to the result. Do not use this if you will use freeze(true). This only supports bytes.length <= blockSize

Link copied to clipboard

Copy bytes in, writing the length as a 1 or 2 byte vInt prefix.

Link copied to clipboard

Commits final byte[], trimming it if necessary and if trim=true

Link copied to clipboard
open override fun ramBytesUsed(): Long

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