Package com.google.api.client.protobuf
Class ProtocolBuffers
- java.lang.Object
-
- com.google.api.client.protobuf.ProtocolBuffers
-
@Beta public class ProtocolBuffers extends Object
Beta
Utilities for protocol buffers.There is no official media type for protocol buffers registered with the IANA.
CONTENT_TYPE
andALT_CONTENT_TYPE
are some of the more popular choices being used today, but other media types are also in use.- Since:
- 1.5
- Author:
- Yaniv Inbar
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALT_CONTENT_TYPE
"application/x-protobuffer"
content type.static String
CONTENT_TYPE
"application/x-protobuf"
content type.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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 Detail
-
CONTENT_TYPE
public static final String CONTENT_TYPE
"application/x-protobuf"
content type.- See Also:
- Constant Field Values
-
ALT_CONTENT_TYPE
public static final String ALT_CONTENT_TYPE
"application/x-protobuffer"
content type.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
-