use of com.google.protobuf.ExtensionRegistry in project j2objc by google.
the class EnumsTest method testMergeFromInputStream.
public void testMergeFromInputStream() throws Exception {
ExtensionRegistry registry = ExtensionRegistry.newInstance();
EnumFields.registerAllExtensions(registry);
ByteArrayInputStream in = new ByteArrayInputStream(ALL_ENUMS_BYTES);
EnumMsg.Builder builder = EnumMsg.newBuilder().mergeFrom(in, registry);
EnumMsg msg = builder.build();
checkFields(builder);
checkFields(msg);
}
use of com.google.protobuf.ExtensionRegistry in project j2objc by google.
the class EnumsTest method testParseFromByteArray.
public void testParseFromByteArray() throws Exception {
ExtensionRegistry registry = ExtensionRegistry.newInstance();
EnumFields.registerAllExtensions(registry);
EnumMsg msg = EnumMsg.parseFrom(ALL_ENUMS_BYTES, registry);
checkFields(msg);
}
use of com.google.protobuf.ExtensionRegistry in project j2objc by google.
the class MessagesTest method testMergeFromInputStream.
public void testMergeFromInputStream() throws Exception {
ExtensionRegistry registry = ExtensionRegistry.newInstance();
MessageFields.registerAllExtensions(registry);
ByteArrayInputStream in = new ByteArrayInputStream(ALL_MESSAGES_BYTES);
MessageData.Builder builder = MessageData.newBuilder().mergeFrom(in, registry);
MessageData msg = builder.build();
checkFields(builder);
checkFields(msg);
}
use of com.google.protobuf.ExtensionRegistry in project j2objc by google.
the class MessagesTest method testParseReversedMessageSets.
public void testParseReversedMessageSets() throws Exception {
ExtensionRegistry registry = ExtensionRegistry.newInstance();
MessageFields.registerAllExtensions(registry);
MessageData msg = MessageData.parseFrom(ALL_MESSAGES_WITH_MESSAGE_SETS_REVERSED_BYTES, registry);
checkFields(msg);
}
use of com.google.protobuf.ExtensionRegistry in project j2objc by google.
the class PerformanceBenchmarks method testMergeFrom.
private static void testMergeFrom() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(PROTO_DATA);
ExtensionRegistry registry = ExtensionRegistry.getEmptyRegistry();
for (int i = 0; i < 30000; i++) {
TypicalData.newBuilder().mergeFrom(in, registry);
}
}
Aggregations