Format

A format to write packed ints.

Entries

Link copied to clipboard

Compact format, all bits are written contiguously.

Link copied to clipboard

A format that may insert padding bits to improve encoding and decoding speed. Since this format doesn't support all possible bits per value, you should never use it directly, but rather use PackedInts.fastestFormatAndBits to find the format that best suits your needs.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
val id: Int

Returns the ID of the format.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard
open fun byteCount(packedIntsVersion: Int, valueCount: Int, bitsPerValue: Int): Long

Computes how many byte blocks are needed to store values values of size bitsPerValue.

Link copied to clipboard
open fun isSupported(bitsPerValue: Int): Boolean

Tests whether the provided number of bits per value is supported by the format.

Link copied to clipboard
open fun longCount(packedIntsVersion: Int, valueCount: Int, bitsPerValue: Int): Int

Computes how many long blocks are needed to store values values of size bitsPerValue.

Link copied to clipboard
open fun overheadPerValue(bitsPerValue: Int): Float

Returns the overhead per value, in bits.

Link copied to clipboard
fun overheadRatio(bitsPerValue: Int): Float

Returns the overhead ratio (overhead per value / bits per value).

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.