tuweni / org.apache.tuweni.rlp / RLPReader

RLPReader

interface RLPReader (source)

A reader for consuming values from an RLP encoded source.

Functions

isComplete

abstract fun isComplete(): Boolean

Check if all values have been read.

isLenient

abstract fun isLenient(): Boolean

Determine if this reader is lenient by default.

A non-lenient reader will throw InvalidRLPEncodingException from any read method if the source RLP has not used a minimal encoding format for the value.

nextIsEmpty

abstract fun nextIsEmpty(): Boolean

Check if the next item to be read is empty.

nextIsList

abstract fun nextIsList(): Boolean

Check if the next item to be read is a list.

readBigInteger

open fun readBigInteger(): BigInteger
open fun readBigInteger(lenient: Boolean): BigInteger

Read a big integer value from the RLP source.

readByte

open fun readByte(): Byte
open fun readByte(lenient: Boolean): Byte

Read a byte from the RLP source.

readByteArray

open fun readByteArray(): ByteArray

Read a byte array from the RLP source.

readInt

open fun readInt(): Int
open fun readInt(lenient: Boolean): Int

Read an integer value from the RLP source.

readList

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

Read a list of values from the RLP source.

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

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

readListContents

open fun <T : Any> readListContents(fn: Function<RLPReader, T>): MutableList<T>
open fun <T : Any> readListContents(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.

readLong

open fun readLong(): Long
open fun readLong(lenient: Boolean): Long

Read a long value from the RLP source.

readString

open fun readString(): String
open fun readString(lenient: Boolean): String

Read a string value from the RLP source.

readUInt256

open fun readUInt256(): UInt256
open fun readUInt256(lenient: Boolean): UInt256

Read a UInt256 value from the RLP source.

readValue

open fun readValue(): Bytes
abstract fun readValue(lenient: Boolean): Bytes

Read the next value from the RLP source.

remaining

abstract fun remaining(): Int

The number of remaining values to read.

skipNext

open fun skipNext(): Unit
abstract fun skipNext(lenient: Boolean): Unit

Skip the next value or list in the RLP source.