use of com.google.protobuf.MessageLite in project j2objc by google.
the class CompatibilityTest method testGetByteArray.
public void testGetByteArray() throws Exception {
// Make sure it compiles with the MessageLite type.
MessageLite data = TypicalData.newBuilder().setMyInt(42).build();
byte[] bytes = data.toByteArray();
byte[] expected = new byte[] { 0x08, 0x2A };
checkBytes(expected, bytes);
}
use of com.google.protobuf.MessageLite in project dubbo by alibaba.
the class ProtobufUtils method serialize.
static void serialize(Object value, OutputStream os) throws IOException {
MessageLite messageLite = (MessageLite) value;
messageLite.writeDelimitedTo(os);
}
Aggregations