tuweni / org.apache.tuweni.ssz / SSZ / decodeString

decodeString

static fun decodeString(source: Bytes!): String! (source)

Read a SSZ encoded string from a Bytes value. Note: prefer to use #decodeString(Bytes, int) instead, especially when reading untrusted data.

Parameters

source - Bytes!: the SSZ encoded bytes

Exceptions

InvalidSSZTypeException - if the next SSZ value is not a byte array, or is too large (greater than 2^32 bytes)

EndOfSSZException - if there are no more SSZ values to read

Return
String!: a string

static fun decodeString(source: Bytes!, limit: Int): String! (source)

Read a SSZ encoded string from a Bytes value.

Parameters

source - Bytes!: the SSZ encoded bytes

limit - Int: the maximum number of bytes to read

Exceptions

InvalidSSZTypeException - if the next SSZ value is not a byte array, or would exceed the limit

EndOfSSZException - if there are no more SSZ values to read

Return
String!: a string