serialize method
Serializes the PackedPoint struct to a ByteBuffer.
Implementation
ByteBuffer serialize() {
final buffer = ByteData(sizeOf<PackedPoint>());
buffer.setInt32(0, x, Endian.host);
buffer.setInt32(4, y, Endian.host);
return buffer.buffer;
}