Skip to content

BitsU16

[Source]

Read or write an unsigned integer of a specified bit width (1–16 bits), returning a U16. Bits are read big-endian.

class val BitsU16 is
  Codec[U16 val] val

Implements


Constructors

create

[Source]

new val create(
  count: U8 val)
: BitsU16 val^

Parameters

  • count: U8 val

Returns


Public Functions

decode

[Source]

fun box decode(
  data: Array[U8 val] val,
  offset: USize val)
: ((U16 val , USize val) | DecodeError)

Parameters

Returns


encode

[Source]

fun box encode(
  value: U16 val)
: (Array[U8 val] val | EncodeError)

Parameters

  • value: U16 val

Returns