Skip to content

Bytes

[Source]

Read or write exactly count bytes.

Requires byte alignment. On encode, the array must have exactly count elements.

class val Bytes is
  Codec[Array[U8 val] val] val

Implements


Constructors

create

[Source]

new val create(
  count: USize val)
: Bytes val^

Parameters

Returns


Public Functions

decode

[Source]

Decode count bytes starting at the given bit offset.

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

Parameters

Returns


encode

[Source]

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

Parameters

Returns