tuweni / org.apache.tuweni.ssz / SSZReader / readFixedBytesList

readFixedBytesList

abstract fun readFixedBytesList(byteLength: Int, limit: Int): MutableList<Bytes!>! (source)

Read a list of known-size fixed length Bytes from the SSZ source. A length mixin IS expected for the list, but IS NOT expected for the list elements.

Parameters

byteLength - Int: The number of fixed-length Bytes per homogenous List element.

limit - Int: The maximum number of bytes to read for each list element.

Exceptions

InvalidSSZTypeException - If the next SSZ value is not a list, any value in the list is not a byte array, or the size of any byte array would exceed the limit.

EndOfSSZException - If there are no more SSZ values to read.

Return
MutableList<Bytes!>!: A list of Bytes.

open fun readFixedBytesList(byteLength: Int): MutableList<Bytes!>! (source)

Read a variable-length list of known-size fixed length Bytes from the SSZ source. Note: prefer to use #readFixedBytesList(int, int) instead, especially when reading untrusted data.

Parameters

byteLength - Int: The number of fixed-length Bytes per homogenous List element.

Exceptions

InvalidSSZTypeException - If the next SSZ value is not a list, any value in the list is not a byte array, or any byte array is too large (greater than 2^32 bytes).

EndOfSSZException - If there are no more SSZ values to read.

Return
MutableList<Bytes!>!: A list of Bytes.