deserializeFromProto method

void deserializeFromProto(
  1. ByteBuffer buffer
)

Deserialize the Point from Protocol Buffer format.

  • buffer: The ByteBuffer containing the serialized data.

Implementation

void deserializeFromProto(ByteBuffer buffer) {
  final data = ByteData.view(buffer);

  // Read x field
  if (data.getUint8(0) == _makeTag(xField.number, xField.wireType)) {
    x = data.getInt32(1, Endian.little);
  }

  // Read y field
  if (data.getUint8(5) == _makeTag(yField.number, yField.wireType)) {
    y = data.getInt32(6, Endian.little);
  }
}