public abstract class ProtobufFormatter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ProtobufFormatter.ParseException
Thrown when parsing an invalid text format message.
|
Constructor and Description |
---|
ProtobufFormatter() |
Modifier and Type | Method and Description |
---|---|
Charset |
getDefaultCharset()
Get the default character set to use for input / output streams
|
abstract void |
merge(InputStream input,
Charset cs,
com.google.protobuf.ExtensionRegistry extensionRegistry,
com.google.protobuf.Message.Builder builder)
Parse a text-format message from
input and merge the contents
into builder . |
void |
merge(InputStream input,
Charset cs,
com.google.protobuf.Message.Builder builder)
Parse a text-format message from
input and merge the contents
into builder . |
void |
merge(InputStream input,
com.google.protobuf.ExtensionRegistry extensionRegistry,
com.google.protobuf.Message.Builder builder) |
void |
merge(InputStream input,
com.google.protobuf.Message.Builder builder) |
void |
print(com.google.protobuf.Message message,
OutputStream output) |
abstract void |
print(com.google.protobuf.Message message,
OutputStream output,
Charset cs)
Outputs a textual representation of the Protocol Message supplied into
the parameter output.
|
void |
print(com.google.protobuf.UnknownFieldSet fields,
OutputStream output) |
abstract void |
print(com.google.protobuf.UnknownFieldSet fields,
OutputStream output,
Charset cs) |
String |
printToString(com.google.protobuf.Message message)
Like
print() , but writes directly to a String and returns it. |
String |
printToString(com.google.protobuf.UnknownFieldSet fields)
Like
print() , but writes directly to a String and returns it. |
void |
setDefaultCharset(Charset cs)
Set the default character set to use for input / output data streams
|
public void setDefaultCharset(Charset cs)
cs
- the character set to use by default, when unspecifiedpublic Charset getDefaultCharset()
public void print(com.google.protobuf.Message message, OutputStream output) throws IOException
message
- the protobuf message to formatoutput
- the stream to write the formatted message using the default charsetIOException
print(Message, OutputStream, Charset)
public abstract void print(com.google.protobuf.Message message, OutputStream output, Charset cs) throws IOException
message
- the protobuf message to formatoutput
- the stream to write the formatted messagecs
- the character set to useIOException
public void print(com.google.protobuf.UnknownFieldSet fields, OutputStream output) throws IOException
fields
- unknown fields to formatoutput
- output the stream to write the formatted message using the default charsetIOException
print(UnknownFieldSet, OutputStream, Charset)
public abstract void print(com.google.protobuf.UnknownFieldSet fields, OutputStream output, Charset cs) throws IOException
fields
- unknown fields to formatoutput
- output the stream to write the formatted messagecs
- the character set to useIOException
public String printToString(com.google.protobuf.Message message)
print()
, but writes directly to a String
and returns it.public String printToString(com.google.protobuf.UnknownFieldSet fields)
print()
, but writes directly to a String
and returns it.public abstract void merge(InputStream input, Charset cs, com.google.protobuf.ExtensionRegistry extensionRegistry, com.google.protobuf.Message.Builder builder) throws IOException
input
and merge the contents
into builder
.IOException
public void merge(InputStream input, Charset cs, com.google.protobuf.Message.Builder builder) throws IOException
input
and merge the contents
into builder
.IOException
public void merge(InputStream input, com.google.protobuf.Message.Builder builder) throws IOException
IOException
public void merge(InputStream input, com.google.protobuf.ExtensionRegistry extensionRegistry, com.google.protobuf.Message.Builder builder) throws IOException
IOException
Copyright © 2019. All rights reserved.