tuweni / org.apache.tuweni.rlp / RLP / decodeToList

decodeToList

static fun decodeToList(source: Bytes!, fn: BiConsumer<RLPReader!, MutableList<Any!>!>!): MutableList<Any!>! (source)

Read an RLP encoded list of values from a Bytes value, populating a mutable output list.

Parameters

source - Bytes!: The RLP encoded bytes.

fn - BiConsumer<RLPReader!, MutableList<Any!>!>!: A function that will be provided a RLPReader.

Exceptions

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

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

Return
MutableList<Any!>!: The list supplied to fn.

static fun decodeToList(source: Bytes!, lenient: Boolean, fn: BiConsumer<RLPReader!, MutableList<Any!>!>!): MutableList<Any!>! (source)

Read an RLP encoded list of values from a Bytes value, populating a mutable output list.

Parameters

source - Bytes!: The RLP encoded bytes.

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

fn - BiConsumer<RLPReader!, MutableList<Any!>!>!: A function that will be provided a RLPReader.

Exceptions

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

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

Return
MutableList<Any!>!: The list supplied to fn.

static fun <T : Any!> decodeToList(source: Bytes!, 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

source - Bytes!: The RLP encoded bytes.

fn - Function<RLPReader!, T>!: 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 first RLP value is not a list.

Return
MutableList<T>!: The list supplied to fn.

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

Read an RLP encoded list of values from a Bytes value, populating a mutable output list.

Parameters

source - Bytes!: The RLP encoded bytes.

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

fn - Function<RLPReader!, T>!: 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 first RLP value is not a list.

Return
MutableList<T>!: The list supplied to fn.