DecoderState

scalus.serialization.flat.DecoderState
class DecoderState(val buffer: Uint8Array)

Mutable bit-level cursor over a flat-encoded byte array. Mirrors EncoderState: bits are read most-significant first within each byte.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def availableBytes(): Int
def bitPosition(): Int
def bits8(numBits: Int): Byte
def ensureBits(requiredBits: Int): Unit
def ensureByteRange(offset: Int, requiredBytes: Int): Unit
def filler(): Unit
def lookupBits8(numBits: Int): Byte

Decode up to 8 bits

Decode up to 8 bits

Value parameters

numBits

the Int of bits to decode [0..8]

Attributes

def remainingBytes(): Array[Byte]
override def toString: String

The cursor and the bytes around it. Every decoding error carries this string, so it shows at most 8 bytes on each side of the cursor, not a whole script.

The cursor and the bytes around it. Every decoding error carries this string, so it shows at most 8 bytes on each side of the cursor, not a whole script.

Attributes

Definition Classes
Any

Concrete fields

var currPtr: Int

Pointer to the current byte being decoded [0..buffer.byteLength)

Pointer to the current byte being decoded [0..buffer.byteLength)

Attributes

var usedBits: Int

Number of already decoded bits in the current byte [0..7]

Number of already decoded bits in the current byte [0..7]

Attributes