tuweni / org.apache.tuweni.ssz / SSZ / decodeBytes

decodeBytes

static fun decodeBytes(source: Bytes!): Bytes! (source)

Read a SSZ encoded bytes from a Bytes value. Note: prefer to use #decodeBytes(Bytes, int) instead, especially when reading untrusted data.

Parameters

source - Bytes!: the SSZ encoded bytes

Exceptions

InvalidSSZTypeException - if the next SSZ value is not a byte array, or is too large (greater than 2^32 bytes)

EndOfSSZException - if there are no more SSZ values to read

Return
Bytes!: the bytes

static fun decodeBytes(source: Bytes!, limit: Int): Bytes! (source)

Read a SSZ encoded bytes from a Bytes value.

Parameters

source - Bytes!: the SSZ encoded bytes

limit - Int: the maximum number of bytes to read

Exceptions

InvalidSSZTypeException - if the next SSZ value is not a byte array, or would exceed the limit

EndOfSSZException - if there are no more SSZ values to read

Return
Bytes!: the bytes