toBytes(__) - OpenDive/AptosKit GitHub Wiki

toBytes(_:)

Deserialize a Data object from the Deserializer's input data buffer.

public static func toBytes(_ deserializer: Deserializer) throws -> Data 

This function reads the length of the data as a ULEB128-encoded integer, followed by reading the data with the obtained length from the input data buffer.

Parameters

  • deserializer: A Deserializer instance to deserialize the data from.

Throws

Any error that may occur during the deserialization process, such as reading the ULEB128-encoded length or the data.

Returns

A Data object deserialized from the input data buffer.