rlp / org.apache.tuweni.rlp / RLP / decodeList

decodeList

static fun <T : Any> decodeList(source: Bytes, fn: Function<RLPReader, T>): T (source)

Read an RLP encoded list of values from a Bytes value.

Parameters

source - The RLP encoded bytes.

fn - A function that will be provided a RLPReader.

- The result type of the reading function.

Exceptions

InvalidRLPEncodingException - If there is an error decoding the RLP source.

InvalidRLPTypeException - If the first RLP value is not a list.

Return
The result from the reading function.

static fun <T : Any> decodeList(source: Bytes, lenient: Boolean, fn: Function<RLPReader, T>): T (source)

Read an RLP encoded list of values from a Bytes value.

Parameters

source - The RLP encoded bytes.

lenient - If false, an exception will be thrown if the value is not minimally encoded.

fn - A function that will be provided a RLPReader.

- The result type of the reading function.

Exceptions

InvalidRLPEncodingException - If there is an error decoding the RLP source.

InvalidRLPTypeException - If the first RLP value is not a list.

Return
The result from the reading function.