tuweni / org.apache.tuweni.rlp / RLPReader / readListContents

readListContents

open fun <T : Any> readListContents(fn: Function<RLPReader, T>): MutableList<T> (source)

Read a list of values from the RLP source, populating a list using a function interpreting each value.

Parameters

fn - A function creating a new element of the list for each value in the RLP list.

- The type of the list elements.

Exceptions

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

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

EndOfRLPException - If there are no more RLP values to read.

Return
The list supplied to fn.

open fun <T : Any> readListContents(lenient: Boolean, fn: Function<RLPReader, T>): MutableList<T> (source)

Read a list of values from the RLP source, populating a list using a function interpreting each value.

Parameters

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

fn - A function creating a new element of the list for each value in the RLP list.

- The type of the list elements.

Exceptions

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

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

EndOfRLPException - If there are no more RLP values to read.

Return
The list supplied to fn.