Class ProtocolBuffers (1.45.2)

public class 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.

Inheritance

java.lang.Object > ProtocolBuffers

Static Fields

ALT_CONTENT_TYPE

public static final String ALT_CONTENT_TYPE

"application/x-protobuffer" content type.

Field Value
Type Description
String

CONTENT_TYPE

public static final String CONTENT_TYPE

"application/x-protobuf" content type.

Field Value
Type Description
String

Static Methods

<T>parseAndClose(InputStream inputStream, Class<T> messageClass)

public static T <T>parseAndClose(InputStream inputStream, Class<T> messageClass)

Parses protocol buffer content from an input stream (closing the input stream) into a protocol buffer message.

Parameters
Name Description
inputStream InputStream
messageClass Class<T>

destination message class that has a parseFrom(InputStream) public static method

Returns
Type Description
T

new instance of the parsed destination message class

Exceptions
Type Description
IOException