tuweni / org.apache.tuweni.rlp / RLP

RLP

class RLP (source)

Recursive Length Prefix (RLP) encoding and decoding.

Functions

decode

Read and decode RLP from a Bytes value.

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

decodeBigInteger

Read an RLP encoded big integer from a Bytes value.

static fun decodeBigInteger(source: Bytes!): BigInteger!
static fun decodeBigInteger(source: Bytes!, lenient: Boolean): BigInteger!

decodeInt

Read an RLP encoded integer from a Bytes value.

static fun decodeInt(source: Bytes!): Int
static fun decodeInt(source: Bytes!, lenient: Boolean): Int

decodeList

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

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

decodeLong

Read an RLP encoded long from a Bytes value.

static fun decodeLong(source: Bytes!): Long
static fun decodeLong(source: Bytes!, lenient: Boolean): Long

decodeString

Read an RLP encoded string from a Bytes value.

static fun decodeString(source: Bytes!): String!
static fun decodeString(source: Bytes!, lenient: Boolean): String!

decodeToList

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

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

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

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

decodeValue

Read an RLP encoded value from a Bytes value.

static fun decodeValue(source: Bytes!): Bytes!
static fun decodeValue(source: Bytes!, lenient: Boolean): Bytes!

encode

Encode values to a Bytes value.

static fun encode(fn: Consumer<RLPWriter!>!): Bytes!

encodeBigInteger

Encode a big integer to a Bytes value.

static fun encodeBigInteger(value: BigInteger!): Bytes!

encodeByteArray

Encode a value to a Bytes value.

static fun encodeByteArray(value: ByteArray!): Bytes!

encodeInt

Encode a integer to a Bytes value.

static fun encodeInt(value: Int): Bytes!

encodeList

Encode a list of values to a Bytes value.

static fun encodeList(fn: Consumer<RLPWriter!>!): Bytes!
static fun <T : Any!> encodeList(elements: MutableList<T>!, fn: BiConsumer<RLPWriter!, T>!): Bytes!

encodeListTo

Encode a list of values to a ByteBuffer.

static fun <T : ByteBuffer!> encodeListTo(buffer: T, fn: Consumer<RLPWriter!>!): T

encodeLong

Encode a long to a Bytes value.

static fun encodeLong(value: Long): Bytes!

encodeString

Encode a string to a Bytes value.

static fun encodeString(str: String!): Bytes!

encodeTo

Encode values to a ByteBuffer.

static fun <T : ByteBuffer!> encodeTo(buffer: T, fn: Consumer<RLPWriter!>!): T

encodeValue

Encode a value to a Bytes value.

static fun encodeValue(value: Bytes!): Bytes!

isList

Check if the Bytes value contains an RLP encoded list.

static fun isList(value: Bytes!): Boolean