The goog.proto2.PbLiteSerializer Class

goog.proto2.PbLiteSerializer
> goog.proto2.LazyDeserializer
> goog.proto2.Serializer

goog.proto2.PbLiteSerializer()

PB-Lite serializer.

.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.

.deserializeField(message, field, data)

Deserializes a message field from the expected format and places the data in the given message

message {goog.proto2.Message}
The message in which to place the information.
field {goog.proto2.FieldDescriptor}
The field for which to set the message value.
data {*}
The serialized data for the field.
returns {*}
The deserialized data or null for no value found.

.deserializeTo(message, data)

Inherited from goog.proto2.LazyDeserializer .

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.

.getDeserializedValue()

.getSerializedValue()

.serialize(message)

Serializes a message to a PB-Lite object.

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

.setZeroIndexed(zeroIndexing)

By default, the proto tag with id 1 will have index 1 in the serialized array. If the serializer is set to use zero-indexing, the tag with id 1 will have index 0.

zeroIndexing {boolean}
Whether this serializer should deal with 0-indexed protos.