The goog.proto2.Serializer Class

goog.proto2.Serializer()

Abstract base class for PB2 serializers. A serializer is a class which implements the serialization and deserialization of a Protocol Buffer Message to/from a specific format.

.deserialize(descriptor, data)

Deserializes a message from the expected format.

descriptor {goog.proto2.Descriptor}
The descriptor of the message to be created.
data {*}
The data of the message.
returns {goog.proto2.Message}
The message created.

.deserializeTo(message, data)

Deserializes a message from the expected format and places the data in the message.

message {goog.proto2.Message}
The message in which to place the information.
data {*}
The data of the message.

.serialize(message)

Serializes a message to the expected format.

message {goog.proto2.Message}
The message to be serialized.
returns {*}
The serialized form of the message.