tuweni / org.apache.tuweni.ssz / SSZWriter

SSZWriter

interface SSZWriter (source)

A writer for encoding values to SSZ.

Functions

writeAddress

Write an address.

open fun writeAddress(address: Bytes!): Unit

writeAddressList

Write a list of addresses.

open fun writeAddressList(vararg elements: Bytes!): Unit
open fun writeAddressList(elements: MutableList<out Bytes!>!): Unit

writeBigInteger

Write a big integer to the output.

open fun writeBigInteger(value: BigInteger!, bitLength: Int): Unit

writeBigIntegerList

Write a list of big integers.

open fun writeBigIntegerList(bitLength: Int, vararg elements: BigInteger!): Unit
open fun writeBigIntegerList(bitLength: Int, elements: MutableList<BigInteger!>!): Unit

writeBoolean

Write a boolean to the output.

open fun writeBoolean(value: Boolean): Unit

writeBooleanList

Write a list of booleans.

open fun writeBooleanList(vararg elements: Boolean): Unit
open fun writeBooleanList(elements: MutableList<Boolean!>!): Unit

writeBytes

Encode a Bytes value to SSZ.

open fun writeBytes(value: Bytes!): Unit

Encode a byte array to SSZ.

open fun writeBytes(value: ByteArray!): Unit

writeBytesList

Write a list of bytes.

open fun writeBytesList(vararg elements: Bytes!): Unit
open fun writeBytesList(elements: MutableList<out Bytes!>!): Unit

writeFixedBytes

Encode a known fixed-length Bytes value to SSZ without the length mixin.

open fun writeFixedBytes(value: Bytes!): Unit

writeFixedBytesList

Write a list of known-size homogenous bytes. The list itself WILL have a length mixin, but the elements WILL NOT.

open fun writeFixedBytesList(elements: MutableList<out Bytes!>!): Unit

writeFixedBytesVector

Write a known-size fixed-length list of known-size homogenous bytes. Neither the list nor the elements in the list will have a length mixin.

open fun writeFixedBytesVector(elements: MutableList<out Bytes!>!): Unit

writeHash

Write a hash.

open fun writeHash(hash: Bytes!): Unit

writeHashList

Write a list of hashes.

open fun writeHashList(vararg elements: Bytes!): Unit
open fun writeHashList(elements: MutableList<out Bytes!>!): Unit

writeInt

Write a two's-compliment integer to the output.

open fun writeInt(value: Int, bitLength: Int): Unit

writeInt16

Write a 16-bit two's-compliment integer to the output.

open fun writeInt16(value: Int): Unit

writeInt16List

Write a list of 16-bit two's compliment integers.

open fun writeInt16List(vararg elements: Int): Unit
open fun writeInt16List(elements: MutableList<Int!>!): Unit

writeInt32

Write a 32-bit two's-compliment integer to the output.

open fun writeInt32(value: Int): Unit

writeInt32List

Write a list of 32-bit two's compliment integers.

open fun writeInt32List(vararg elements: Int): Unit
open fun writeInt32List(elements: MutableList<Int!>!): Unit

writeInt64

Write a 64-bit two's-compliment integer to the output.

open fun writeInt64(value: Long): Unit

writeInt64List

Write a list of 64-bit two's compliment integers.

open fun writeInt64List(vararg elements: Long): Unit
open fun writeInt64List(elements: MutableList<Long!>!): Unit

writeInt8

Write an 8-bit two's-compliment integer to the output.

open fun writeInt8(value: Int): Unit

writeInt8List

Write a list of 8-bit two's compliment integers.

open fun writeInt8List(vararg elements: Int): Unit
open fun writeInt8List(elements: MutableList<Int!>!): Unit

writeIntList

Write a list of two's compliment integers.

open fun writeIntList(bitLength: Int, vararg elements: Int): Unit
open fun writeIntList(bitLength: Int, elements: MutableList<Int!>!): Unit

writeLong

Write a two's-compliment long to the output.

open fun writeLong(value: Long, bitLength: Int): Unit

writeLongIntList

Write a list of two's compliment long integers.

open fun writeLongIntList(bitLength: Int, vararg elements: Long): Unit
open fun writeLongIntList(bitLength: Int, elements: MutableList<Long!>!): Unit

writeSSZ

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

abstract fun writeSSZ(value: Bytes!): Unit
open fun writeSSZ(value: ByteArray!): Unit

writeString

Write a string to the output.

open fun writeString(str: String!): Unit

writeStringList

Write a list of strings, which must be of the same length

open fun writeStringList(vararg elements: String!): Unit
open fun writeStringList(elements: MutableList<String!>!): Unit

writeUBigInteger

Write an unsigned big integer to the output.

open fun writeUBigInteger(value: BigInteger!, bitLength: Int): Unit

writeUInt

Write an unsigned integer to the output. Note that the argument value is a native signed int but will be interpreted as an unsigned value.

open fun writeUInt(value: Int, bitLength: Int): Unit

writeUInt16

Write a 16-bit unsigned integer to the output.

open fun writeUInt16(value: Int): Unit

writeUInt16List

Write a list of 16-bit unsigned integers.

open fun writeUInt16List(vararg elements: Int): Unit
open fun writeUInt16List(elements: MutableList<Int!>!): Unit

writeUInt256

Write a UInt256 to the output.

open fun writeUInt256(value: UInt256!): Unit

writeUInt256List

Write a list of unsigned 256-bit integers.

open fun writeUInt256List(vararg elements: UInt256!): Unit
open fun writeUInt256List(elements: MutableList<UInt256!>!): Unit

writeUInt32

Write a 32-bit unsigned integer to the output.

open fun writeUInt32(value: Long): Unit

writeUInt32List

Write a list of 32-bit unsigned integers.

open fun writeUInt32List(vararg elements: Long): Unit
open fun writeUInt32List(elements: MutableList<Long!>!): Unit

writeUInt384

Write a UInt384 to the output.

open fun writeUInt384(value: UInt384!): Unit

writeUInt384List

Write a list of unsigned 384-bit integers.

open fun writeUInt384List(elements: MutableList<UInt384!>!): Unit
open fun writeUInt384List(vararg elements: UInt384!): Unit

writeUInt64

Write a 64-bit unsigned integer to the output. Note that the argument value is a native signed long but will be interpreted as an unsigned value.

open fun writeUInt64(value: Long): Unit

writeUInt64List

Write a list of 64-bit unsigned integers. Note that the elements are native signed longs, but will be interpreted as an unsigned values.

open fun writeUInt64List(vararg elements: Long): Unit
open fun writeUInt64List(elements: MutableList<Long!>!): Unit

writeUInt8

Write an 8-bit unsigned integer to the output.

open fun writeUInt8(value: Int): Unit

writeUInt8List

Write a list of 8-bit unsigned integers.

open fun writeUInt8List(vararg elements: Int): Unit
open fun writeUInt8List(elements: MutableList<Int!>!): Unit

writeUIntList

Write a list of unsigned integers. Note that the elements are native signed ints, but will be interpreted as an unsigned values.

open fun writeUIntList(bitLength: Int, vararg elements: Int): Unit
open fun writeUIntList(bitLength: Int, elements: MutableList<Int!>!): Unit

writeULong

Write an unsigned long to the output. Note that the argument value is a native signed long but will be interpreted as an unsigned value.

open fun writeULong(value: Long, bitLength: Int): Unit

writeULongIntList

Write a list of unsigned long integers. Note that the elements are native signed longs, but will be interpreted as an unsigned values.

open fun writeULongIntList(bitLength: Int, vararg elements: Long): Unit
open fun writeULongIntList(bitLength: Int, elements: MutableList<Long!>!): Unit

writeVector

Write a vector of bytes.

open fun writeVector(elements: MutableList<out Bytes!>!): Unit