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­Checked


public method ProtoReadChecked → (2)

record in : Record

The record in the wire stream of type Wire.LEN to use for reading a value.

hasValue out : bool

true if a value has been read from record in,
false if no value has been read.

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 → (2)

record in : Record

The record in the wire stream of type Wire.LEN to use for writing the given value in.

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 the content of a single message record.

IOException

If an I/O error has occurred.

Extensions

Proto­Read


public static method ProtoRead → (2)<T>

record in : Record

The record in the wire stream of type Wire.LEN to use for reading a value.

defaultValue opt : T = default(T)

The default value to use if the record in does not contain a value. false if the record is empty.

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.