Class ProtocolBuffers (1.41.8)

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
TypeDescription
String

CONTENT_TYPE

public static final String CONTENT_TYPE

"application/x-protobuf" content type.

Field Value
TypeDescription
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
NameDescription
inputStreamInputStream
messageClassClass<T>

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

Returns
TypeDescription
T

new instance of the parsed destination message class

Exceptions
TypeDescription
IOException