@Beta public class ProtocolBuffers extends Object
Beta There is no official media type for protocol buffers registered with the IANA. CONTENT_TYPE and ALT_CONTENT_TYPE are some of the more popular choices being used
today, but other media types are also in use.
| Modifier and Type | Field and Description |
|---|---|
static String |
ALT_CONTENT_TYPE
"application/x-protobuffer" content type. |
static String |
CONTENT_TYPE
"application/x-protobuf" content type. |
| Modifier and Type | Method and Description |
|---|---|
static <T extends com.google.protobuf.MessageLite> |
parseAndClose(InputStream inputStream,
Class<T> messageClass)
Parses protocol buffer content from an input stream (closing the input stream) into a protocol
buffer message.
|
public static final String CONTENT_TYPE
"application/x-protobuf" content type.public static final String ALT_CONTENT_TYPE
"application/x-protobuffer" content type.public static <T extends com.google.protobuf.MessageLite> T parseAndClose(InputStream inputStream, Class<T> messageClass) throws IOException
T - destination message typemessageClass - destination message class that has a parseFrom(InputStream) public
static methodIOExceptionCopyright © 2011–2019 Google. All rights reserved.