ssz / org.apache.tuweni.ssz / SSZ / encodeTo

encodeTo

static fun <T : ByteBuffer> encodeTo(buffer: T, fn: Consumer<SSZWriter>): T (source)

Encode values to a ByteBuffer.

Parameters

buffer - The buffer to write into, starting from its current position.

fn - A consumer that will be provided with a SSZWriter that can consume values.

- The type of the buffer.

Exceptions

BufferOverflowException - if the writer attempts to write more than the provided buffer can hold

ReadOnlyBufferException - if the provided buffer is read-only

Return
The buffer.