@Test public void parseFromKnowLengthInputStream() throws Exception { Marshaller<Type> marshaller = ProtoLiteUtils.marshaller(Type.getDefaultInstance()); Type expect = Type.newBuilder().setName("expected name").build(); Type result = marshaller.parse(new CustomKnownLengthInputStream(expect.toByteArray())); assertEquals(expect, result); }
public static <T extends MessageLite> Marshaller<T> marshaller(T defaultInstance) { return new MessageMarshaller<T>(defaultInstance); }
ProtoLiteUtils { public static <T extends MessageLite> Marshaller<T> marshaller(T defaultInstance) { return new MessageMarshaller<T>(defaultInstance); } }
ProtoLiteUtils { public static <T extends MessageLite> Marshaller<T> marshaller(T defaultInstance) { return new MessageMarshaller<T>(defaultInstance); } private  ProtoLiteUtils(); }
ProtoLiteUtils { public static <T extends MessageLite> Marshaller<T> marshaller(T defaultInstance) { return new MessageMarshaller<T>(defaultInstance); } private  ProtoLiteUtils(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1787") static void setExtensionRegistry(ExtensionRegistryLite newRegistry); static Marshaller<T> marshaller(T defaultInstance); static Metadata.BinaryMarshaller<T> metadataMarshaller(
      T defaultInstance); }
ProtoLiteUtils { public static <T extends MessageLite> Marshaller<T> marshaller(T defaultInstance) { return new MessageMarshaller<T>(defaultInstance); } private  ProtoLiteUtils(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1787") static void setExtensionRegistry(ExtensionRegistryLite newRegistry); static Marshaller<T> marshaller(T defaultInstance); static Metadata.BinaryMarshaller<T> metadataMarshaller(
      T defaultInstance);  }