init(contiguousBytes:extensions:partial:options:)

Creates a new message by decoding the given Foundation/ContiguousBytes value containing a serialized message in Protocol Buffer binary format.

Message+BinaryAdditions_Data.swift:62

This declaration has been renamed to init(serializedBytes:extensions:partial:options:).

This declaration is deprecated.

init<Bytes>(contiguousBytes bytes: Bytes, extensions: (any ExtensionMap)? = nil, partial: Bool = false, options: BinaryDecodingOptions = BinaryDecodingOptions()) throws where Bytes : ContiguousBytes

Parameters

contiguousBytes

The binary-encoded message data to decode.

extensions

An ExtensionMap used to look up and decode any extensions in this message or messages nested within this message’s fields.

partial

If false (the default), this method will check isInitialized after decoding to verify that all required fields are present. If any are missing, this method throws SwiftProtobufError/BinaryDecoding/missingRequiredFields.

options

The BinaryDecodingOptions to use.

Throws

SwiftProtobufError if decoding fails.