rlp / org.apache.tuweni.rlp / RLPWriter

RLPWriter

interface RLPWriter (source)

A writer for encoding values to RLP.

Functions

writeBigInteger

open fun writeBigInteger(value: BigInteger): Unit

Write a big integer to the output.

writeByte

open fun writeByte(value: Byte): Unit

Encode a byte to RLP.

writeByteArray

open fun writeByteArray(value: ByteArray): Unit

Encode a byte array to RLP.

writeInt

open fun writeInt(value: Int): Unit

Write an integer to the output.

writeList

abstract fun writeList(fn: Consumer<RLPWriter>): Unit

Write a list of values.

open fun <T : Any> writeList(elements: MutableList<T>, elementWriter: BiConsumer<RLPWriter, T>): Unit

Write a list of values, sending each value to a function to be interpreted.

writeLong

abstract fun writeLong(value: Long): Unit

Write a long to the output.

writeRLP

abstract fun writeRLP(value: Bytes): Unit

Append an already RLP encoded value.

Note that this method may not validate that value is a valid RLP sequence. Appending an invalid RLP sequence will cause the entire RLP encoding produced by this writer to also be invalid.

writeString

open fun writeString(str: String): Unit

Write a string to the output.

writeUInt256

open fun writeUInt256(value: UInt256): Unit

Write a UInt256 to the output.

writeValue

abstract fun writeValue(value: Bytes): Unit

Encode a Bytes value to RLP.