tuweni / org.apache.tuweni.ssz / SSZReader

SSZReader

interface SSZReader (source)

A reader for consuming values from an SSZ encoded source.

Functions

isComplete

abstract fun isComplete(): Boolean

Check if all values have been read.

readAddress

abstract fun readAddress(): Bytes

Read a 20-byte address from the SSZ source.

readAddressList

abstract fun readAddressList(): MutableList<Bytes>

Read a list of 20-byte addresses from the SSZ source.

readBigInteger

abstract fun readBigInteger(bitLength: Int): BigInteger

Read a big integer value from the SSZ source.

readBigIntegerList

abstract fun readBigIntegerList(bitLength: Int): MutableList<BigInteger>

Read a list of two's-compliment big integer values from the SSZ source.

readBoolean

open fun readBoolean(): Boolean

Read a boolean from the SSZ source.

readBooleanList

abstract fun readBooleanList(): MutableList<Boolean>

Read a list of booleans from the SSZ source.

readByteArray

open fun readByteArray(): ByteArray

Read a byte array from the SSZ source. Note: prefer to use #readByteArray(int) instead, especially when reading untrusted data.

open fun readByteArray(limit: Int): ByteArray

Read a byte array from the SSZ source.

readByteArrayList

open fun readByteArrayList(): MutableList<ByteArray>

Read a list of byte arrays from the SSZ source. Note: prefer to use #readByteArrayList(int) instead, especially when reading untrusted data.

open fun readByteArrayList(limit: Int): MutableList<ByteArray>

Read a list of byte arrays from the SSZ source.

readBytes

open fun readBytes(): Bytes

Read bytes from the SSZ source. Note: prefer to use #readBytes(int) instead, especially when reading untrusted data.

abstract fun readBytes(limit: Int): Bytes

Read bytes from the SSZ source.

readBytesList

open fun readBytesList(): MutableList<Bytes>

Read a list of Bytes from the SSZ source. Note: prefer to use #readBytesList(int) instead, especially when reading untrusted data.

abstract fun readBytesList(limit: Int): MutableList<Bytes>

Read a list of Bytes from the SSZ source.

readFixedByteArray

open fun readFixedByteArray(byteLength: Int, limit: Int): ByteArray

Read an array of fixed-length homogenous Bytes from the SSZ source.

readFixedBytes

open fun readFixedBytes(byteLength: Int): Bytes

Read a known size fixed-length bytes value from the SSZ source. Note: prefer to use #readFixedBytes(int, int) instead, especially when reading untrusted data.

abstract fun readFixedBytes(byteLength: Int, limit: Int): Bytes

Read a known size fixed-length bytes value from the SSZ source.

readFixedBytesList

abstract fun readFixedBytesList(byteLength: Int, limit: Int): MutableList<Bytes>

Read a list of known-size fixed length Bytes from the SSZ source. A length mixin IS expected for the list, but IS NOT expected for the list elements.

open fun readFixedBytesList(byteLength: Int): MutableList<Bytes>

Read a variable-length list of known-size fixed length Bytes from the SSZ source. Note: prefer to use #readFixedBytesList(int, int) instead, especially when reading untrusted data.

readFixedBytesVector

abstract fun readFixedBytesVector(listSize: Int, byteLength: Int, limit: Int): MutableList<Bytes>

Read a known-size fixed length list of known-size fixed length Bytes from the SSZ source.

open fun readFixedBytesVector(listSize: Int, byteLength: Int): MutableList<Bytes>

Read a known-size fixed length list of known-size fixed length Bytes from the SSZ source. Note: prefer to use #readFixedBytesVector(int, int, int) instead, especially when reading untrusted data.

readHash

abstract fun readHash(hashLength: Int): Bytes

Read a hash from the SSZ source.

readHashList

abstract fun readHashList(hashLength: Int): MutableList<Bytes>

Read a list of hashes from the SSZ source.

readInt

abstract fun readInt(bitLength: Int): Int

Read a two's-compliment int value from the SSZ source.

readInt16

open fun readInt16(): Int

Read a 16-bit two's-compliment integer from the SSZ source.

readInt16List

open fun readInt16List(): MutableList<Int>

Read a list of 16-bit two's-compliment int values from the SSZ source.

readInt32

open fun readInt32(): Int

Read a 32-bit two's-compliment integer from the SSZ source.

readInt32List

open fun readInt32List(): MutableList<Int>

Read a list of 32-bit two's-compliment int values from the SSZ source.

readInt64

open fun readInt64(): Long

Read a 64-bit two's-compliment integer from the SSZ source.

readInt64List

open fun readInt64List(): MutableList<Long>

Read a list of 64-bit two's-compliment int values from the SSZ source.

readInt8

open fun readInt8(): Int

Read an 8-bit two's-compliment integer from the SSZ source.

readInt8List

open fun readInt8List(): MutableList<Int>

Read a list of 8-bit two's-compliment int values from the SSZ source.

readIntList

abstract fun readIntList(bitLength: Int): MutableList<Int>

Read a list of two's-compliment int values from the SSZ source.

readLong

abstract fun readLong(bitLength: Int): Long

Read a two's-compliment long value from the SSZ source.

readLongIntList

abstract fun readLongIntList(bitLength: Int): MutableList<Long>

Read a list of two's-compliment long int values from the SSZ source.

readString

open fun readString(): String

Read a string value from the SSZ source. Note: prefer to use #readString(int) instead, especially when reading untrusted data.

open fun readString(limit: Int): String

Read a string value from the SSZ source.

readStringList

open fun readStringList(): MutableList<String>

Read a list of strings from the SSZ source. Note: prefer to use #readStringList(int) instead, especially when reading untrusted data.

abstract fun readStringList(limit: Int): MutableList<String>

Read a list of strings from the SSZ source.

readUInt

open fun readUInt(bitLength: Int): Int

Read an unsigned int value from the SSZ source.

readUInt16

open fun readUInt16(): Int

Read a 16-bit unsigned integer from the SSZ source.

readUInt16List

open fun readUInt16List(): MutableList<Int>

Read a list of 16-bit unsigned int values from the SSZ source.

readUInt256

abstract fun readUInt256(): UInt256

Read a UInt256 from the SSZ source.

readUInt256List

abstract fun readUInt256List(): MutableList<UInt256>

Read a list of 256-bit unsigned int values from the SSZ source.

readUInt32

open fun readUInt32(): Long

Read a 32-bit unsigned integer from the SSZ source.

readUInt32List

open fun readUInt32List(): MutableList<Long>

Read a list of 32-bit unsigned int values from the SSZ source.

readUInt384

abstract fun readUInt384(): UInt384

Read a UInt384 from the SSZ source.

readUInt384List

abstract fun readUInt384List(): MutableList<UInt384>

Read a list of 384-bit unsigned int values from the SSZ source.

readUInt64

open fun readUInt64(): Long

Read a 64-bit unsigned integer from the SSZ source.

readUInt64List

open fun readUInt64List(): MutableList<Long>

Read a list of 64-bit unsigned int values from the SSZ source.

readUInt8

open fun readUInt8(): Int

Read an 8-bit unsigned integer from the SSZ source.

readUInt8List

open fun readUInt8List(): MutableList<Int>

Read a list of 8-bit unsigned int values from the SSZ source.

readUIntList

open fun readUIntList(bitLength: Int): MutableList<Int>

Read a list of unsigned int values from the SSZ source.

readULong

open fun readULong(bitLength: Int): Long

Read an unsigned long value from the SSZ source.

readULongIntList

open fun readULongIntList(bitLength: Int): MutableList<Long>

Read a list of unsigned long int values from the SSZ source.

readUnsignedBigInteger

abstract fun readUnsignedBigInteger(bitLength: Int): BigInteger

Read an unsigned big integer value from the SSZ source.

readUnsignedBigIntegerList

abstract fun readUnsignedBigIntegerList(bitLength: Int): MutableList<BigInteger>

Read a list of unsigned big integer values from the SSZ source.

readVector

open fun readVector(listSize: Long): MutableList<Bytes>

Read a known-size fixed-length list of Bytes from the SSZ source. The list WILL NOT have a length mixin, where as the elements WILL. Note: prefer to use #readVector(long, int) instead, especially when reading untrusted data.

abstract fun readVector(listSize: Long, limit: Int): MutableList<Bytes>

Read a known-size fixed-length list of Bytes from the SSZ source.