IProtoConverter

Description

interface Tinman.Core.IO.Serialization.IProtoConverter<T>

Base interface for classes that convert between atomic values and the Protocol Buffers wire format.

Public / Methods

Proto​Read


public method ProtoRead → (3)

wire in : IProtonizer

[not-null]
The message stream.

record in : Record

The message record.

defaultValue opt : T = default(T)

The default value to use if the wire in format is invalid.

returns → T

The read value.

Reads a value from the given Protocol Buffers wire format stream.

The calling code is aware of the message type and calls this method on the message record (see IProtonizer.ReadRecord) that fully contains the encoded value.

IOException

If an I/O error has occurred.

Proto​Write


public method ProtoWrite → (3)

wire in : IProtonizer

[not-null]
The stream.

field in : int32

The field number to use for the message record.

value in : T

The value to write.

Writes the given value to a Protocol Buffers wire format stream.

The calling code is aware of the message type and thus chooses the field number. This method is responsible for writing a single message record (see IProtonizer.WriteRecord), using the field number.

IOException

If an I/O error has occurred.