class RLP
(source)
Recursive Length Prefix (RLP) encoding and decoding.
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
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 |
|
static fun decodeBigInteger(source: Bytes): BigInteger static fun decodeBigInteger(source: Bytes, lenient: Boolean): BigInteger
Read an RLP encoded big integer from a Bytes value. |
|
static fun decodeInt(source: Bytes): Int static fun decodeInt(source: Bytes, lenient: Boolean): Int
Read an RLP encoded integer 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
Read an RLP encoded list of values from a Bytes value. |
|
static fun decodeLong(source: Bytes): Long static fun decodeLong(source: Bytes, lenient: Boolean): Long
Read an RLP encoded long from a Bytes value. |
|
static fun decodeString(source: Bytes): String static fun decodeString(source: Bytes, lenient: Boolean): String
Read an RLP encoded string from a Bytes value. |
|
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 an RLP encoded list of values from a Bytes value, populating a mutable output list. static fun <T : Any> decodeToList(source: Bytes, 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 decodeValue(source: Bytes): Bytes static fun decodeValue(source: Bytes, lenient: Boolean): Bytes
Read an RLP encoded value from a Bytes value. |
|
static fun encode(fn: Consumer<RLPWriter>): Bytes
Encode values to a Bytes value. Important: this method does not write any list prefix to the result. If you are writing a RLP encoded list of values, you usually want to use |
|
static fun encodeBigInteger(value: BigInteger): Bytes
Encode a big integer to a Bytes value. |
|
static fun encodeByteArray(value: ByteArray): Bytes
Encode a value to a Bytes value. |
|
static fun encodeInt(value: Int): Bytes
Encode a integer to a Bytes value. |
|
static fun encodeList(fn: Consumer<RLPWriter>): Bytes static fun <T : Any> encodeList(elements: MutableList<T>, fn: BiConsumer<RLPWriter, T>): Bytes
Encode a list of values to a Bytes value. |
|
static fun <T : ByteBuffer> encodeListTo(buffer: T, fn: Consumer<RLPWriter>): T
Encode a list of values to a ByteBuffer. |
|
static fun encodeLong(value: Long): Bytes
Encode a long to a Bytes value. |
|
static fun encodeString(str: String): Bytes
Encode a string to a Bytes value. |
|
static fun <T : ByteBuffer> encodeTo(buffer: T, fn: Consumer<RLPWriter>): T
Encode values to a ByteBuffer. Important: this method does not write any list prefix to the result. If you are writing a RLP encoded list of values, you usually want to use |
|
static fun encodeValue(value: Bytes): Bytes
Encode a value to a Bytes value. |
|
static fun isList(value: Bytes): Boolean
Check if the Bytes value contains an RLP encoded list. |