Google.Protobuf.MessageParser

A general message parser, typically used by reflection-based code as all the methods return simple IMessage.

Summary

Inheritance

Direct Known Subclasses:Google.Protobuf.MessageParser< T >

Public functions

ParseDelimitedFrom(Stream input)
IMessage
Parses a length-delimited message from the given stream.
ParseFrom(byte[] data)
IMessage
Parses a message from a byte array.
ParseFrom(ByteString data)
IMessage
Parses a message from the given byte string.
ParseFrom(Stream input)
IMessage
Parses a message from the given stream.
ParseFrom(CodedInputStream input)
IMessage
Parses a message from the given coded input stream.
ParseJson(string json)
IMessage
Parses a message from the given JSON.

Public functions

ParseDelimitedFrom

IMessage ParseDelimitedFrom(
  Stream input
)

Parses a length-delimited message from the given stream.

The stream is expected to contain a length and then the data. Only the amount of data specified by the length will be consumed.

Details
Parameters
input
The stream to parse.
Returns
The parsed message.

ParseFrom

IMessage ParseFrom(
  byte[] data
)

Parses a message from a byte array.

Details
Parameters
data
The byte array containing the message. Must not be null.
Returns
The newly parsed message.

ParseFrom

IMessage ParseFrom(
  ByteString data
)

Parses a message from the given byte string.

Details
Parameters
data
The data to parse.
Returns
The parsed message.

ParseFrom

IMessage ParseFrom(
  Stream input
)

Parses a message from the given stream.

Details
Parameters
input
The stream to parse.
Returns
The parsed message.

ParseFrom

IMessage ParseFrom(
  CodedInputStream input
)

Parses a message from the given coded input stream.

Details
Parameters
input
The stream to parse.
Returns
The parsed message.

ParseJson

IMessage ParseJson(
  string json
)

Parses a message from the given JSON.

Details
Parameters
json
The JSON to parse.
Exceptions
InvalidJsonException
The JSON does not comply with RFC 7159
InvalidProtocolBufferException
The JSON does not represent a Protocol Buffers message correctly
Returns
The parsed message.