Skip to content

sequence(valueDecoder_)

MarcoDotIO edited this page Apr 25, 2023 · 1 revision

sequence(valueDecoder:)

Deserialize a sequence of values from the Deserializer's input data buffer.

public func sequence<T>(valueDecoder: (Deserializer) throws -> T) throws -> [T] 

This function first reads the length of the sequence as a ULEB128-encoded integer. Then, it iteratively decodes values using the provided valueDecoder closure until the desired number of elements is deserialized.

Parameters

  • valueDecoder: A closure that takes a Deserializer instance and returns a decoded value of type T.

Throws

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

Returns

An array of [T] deserialized from the input data buffer.

Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally