tuweni / org.apache.tuweni.ssz / SSZReader / readFixedBytes

readFixedBytes

open fun readFixedBytes(byteLength: Int): Bytes! (source)

Read a known size fixed-length bytes value from the SSZ source. Note: prefer to use #readFixedBytes(int, int) instead, especially when reading untrusted data.

Parameters

byteLength - Int: The number of fixed-length Bytes (no length mixin) to read.

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 for the next value.

abstract fun readFixedBytes(byteLength: Int, limit: Int): Bytes! (source)

Read a known size fixed-length bytes value from the SSZ source.

Parameters

byteLength - Int: The number of fixed-length Bytes (no length mixin) to read.

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 for the next value.