Package com.google.api.client.protobuf
Class ProtocolBuffers
java.lang.Object
com.google.api.client.protobuf.ProtocolBuffers
Beta
Utilities for protocol buffers.
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.
- Since:
- 1.5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends com.google.protobuf.MessageLite>
TparseAndClose
(InputStream inputStream, Class<T> messageClass) Parses protocol buffer content from an input stream (closing the input stream) into a protocol buffer message.
-
Field Details
-
CONTENT_TYPE
"application/x-protobuf"
content type.- See Also:
-
ALT_CONTENT_TYPE
"application/x-protobuffer"
content type.- See Also:
-
-
Constructor Details
-
ProtocolBuffers
private ProtocolBuffers()
-
-
Method Details
-
parseAndClose
public static <T extends com.google.protobuf.MessageLite> T parseAndClose(InputStream inputStream, Class<T> messageClass) throws IOException Parses protocol buffer content from an input stream (closing the input stream) into a protocol buffer message.- Type Parameters:
T
- destination message type- Parameters:
messageClass
- destination message class that has aparseFrom(InputStream)
public static method- Returns:
- new instance of the parsed destination message class
- Throws:
IOException
-