EncoderState

scalus.serialization.flat.EncoderState
class EncoderState(bufferSize: Int)

Mutable bit-level output buffer for flat encoding. Bits are accumulated into currentByte (most-significant first) and flushed to buffer one byte at a time. The caller must pre-size bufferSize from Flat.bitSize — the buffer does not grow.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def bitPosition(): Int
def bits(numBits: Int, value: Byte): Unit
def filler(): Unit

Pads with zero bits to the next byte boundary, ending with a single one bit — flat's Filler (pre-alignment used before byte-aligned primitives).

Pads with zero bits to the next byte boundary, ending with a single one bit — flat's Filler (pre-alignment used before byte-aligned primitives).

Attributes

def nextWord(): Unit
def result: Array[Byte]

The bytes encoded so far, including a trailing partially-filled byte if any (unused low bits are zero).

The bytes encoded so far, including a trailing partially-filled byte if any (unused low bits are zero).

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Concrete fields

val buffer: Array[Byte]
var currentByte: Int
var nextPtr: Int
var usedBits: Int