Search in sources :

Example 16 with MessageLite

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);
}
Also used : MessageLite(com.google.protobuf.MessageLite)

Example 17 with MessageLite

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);
}
Also used : MessageLite(com.google.protobuf.MessageLite)

Aggregations

MessageLite (com.google.protobuf.MessageLite)17 PublicKeySign (com.google.crypto.tink.PublicKeySign)2 PublicKeyVerify (com.google.crypto.tink.PublicKeyVerify)2 Ed25519PrivateKey (com.google.crypto.tink.proto.Ed25519PrivateKey)2 KeyTemplate (com.google.crypto.tink.proto.KeyTemplate)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 GeneralSecurityException (java.security.GeneralSecurityException)2 Test (org.junit.Test)2 TypicalData (protos.TypicalData)2 Ed25519Sign (com.google.crypto.tink.subtle.Ed25519Sign)1 Ed25519Verify (com.google.crypto.tink.subtle.Ed25519Verify)1 Descriptors (com.google.protobuf.Descriptors)1 ExtensionRegistryLite (com.google.protobuf.ExtensionRegistryLite)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 Parser (com.google.protobuf.Parser)1 Deadline (io.grpc.Deadline)1 ForwardingClientCallListener (io.grpc.ForwardingClientCallListener)1 Metadata (io.grpc.Metadata)1 Status (io.grpc.Status)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1