tuweni / org.apache.tuweni.rlp / RLP / decode

decode

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

Read and decode RLP from a Bytes value.

Important: this method does not consume any list prefix from the source data. If you are reading a RLP encoded list of values, you usually want to use #decodeList(Bytes, Function).

Parameters

source - Bytes!: The RLP encoded bytes.

fn - Function<RLPReader!, T>!: A function that will be provided a RLPReader.

- The result type of the reading function.

Return
T: The result from the reading function.

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

Read and decode RLP from a Bytes value.

Important: this method does not consume any list prefix from the source data. If you are reading a RLP encoded list of values, you usually want to use #decodeList(Bytes, Function).

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 that will be provided a RLPReader.

- The result type of the reading function.

Return
T: The result from the reading function.