tuweni / org.apache.tuweni.rlp / RLPReader / readList

readList

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

Read a list of values from the RLP source.

Parameters

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 next RLP value is not a list.

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

Return
The result from the reading function.

abstract fun <T : Any> readList(lenient: Boolean, fn: Function<RLPReader, T>): T (source)

Read a list of values from the RLP source.

Parameters

lenient - If false, an exception will be thrown if the integer 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 next RLP value is not a list.

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

Return
The result from the reading function.

open fun readList(fn: BiConsumer<RLPReader, MutableList<Any>>): MutableList<Any> (source)

Read a list of values from the RLP source, populating a mutable output list.

Parameters

fn - A function that will be provided with a RLPReader and a mutable output list.

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 readList(lenient: Boolean, fn: BiConsumer<RLPReader, MutableList<Any>>): MutableList<Any> (source)

Read a list of values from the RLP source, populating a mutable output list.

Parameters

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

fn - A function that will be provided with a RLPReader and a mutable output list.

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.