Google.ProtocolBuffers.Serialization
Class containing helpful workarounds for various platform compatibility
Extension methods for using serializers on instances of IMessageLite/IBuilderLite
Serializes the message to JSON text. This is a trivial wrapper
around Serialization.JsonFormatWriter.WriteMessage.
Serializes the message to XML text. This is a trivial wrapper
around Serialization.XmlFormatWriter.WriteMessage.
Serializes the message to XML text using the element name provided.
This is a trivial wrapper around Serialization.XmlFormatWriter.WriteMessage.
Writes the message instance to the stream using the content type provided
An instance of a message
Options specific to writing this message and/or content type
The mime type of the content to be written
The stream to write the message to
Merges a JSON object into this builder and returns
Merges a JSON object into this builder and returns
Merges a JSON object into this builder using the extensions provided and returns
Merges an XML object into this builder and returns
Merges an XML object into this builder and returns
Merges an XML object into this builder using the extensions provided and returns
Merges the message from the input stream based on the contentType provided
A type derived from IBuilderLite
An instance of a message builder
Options specific to reading this message and/or content type
The mime type of the input stream content
The stream to read the message from
The same builder instance that was supplied in the builder parameter
Used to implement a service endpoint on an HTTP server. This works with services generated with the
service_generator_type option set to IRPCDISPATCH.
The service execution stub
The name of the method being invoked
optional arguments for the format reader/writer
The mime type for the input stream
The input stream
The mime type for the output stream
The output stream
Allows reading messages from a name/value dictionary
Provides a base class for text-parsing readers
Provides a base-class that provides some basic functionality for handling type dispatching
Constructs a new reader
Merges the contents of stream into the provided message builder
Merges the contents of stream into the provided message builder
Peeks at the next field in the input stream and returns what information is available.
This may be called multiple times without actually reading the field. Only after the field
is either read, or skipped, should PeekNext return a different value.
Causes the reader to skip past this field
Returns true if it was able to read a Boolean from the input
Returns true if it was able to read a Int32 from the input
Returns true if it was able to read a UInt32 from the input
Returns true if it was able to read a Int64 from the input
Returns true if it was able to read a UInt64 from the input
Returns true if it was able to read a Single from the input
Returns true if it was able to read a Double from the input
Returns true if it was able to read a String from the input
Returns true if it was able to read a ByteString from the input
returns true if it was able to read a single value into the value reference. The value
stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap.
Merges the input stream into the provided IBuilderLite
Reads the root-message preamble specific to this formatter
Reads the root-message close specific to this formatter
Merges the input stream into the provided IBuilderLite
Cursors through the array elements and stops at the end of the array
Reads an array of T messages
Reads an array of T messages as a proto-buffer group
Reads an array of System.Enum type T and adds them to the collection
Reads an array of T, where T is a primitive type defined by FieldType
returns true if it was able to read a single primitive value of FieldType into the value reference
Gets or sets the maximum recursion depth allowed
Constructs a new reader
Reads a typed field as a string
Returns true if it was able to read a String from the input
Returns true if it was able to read a Boolean from the input
Returns true if it was able to read a Int32 from the input
Returns true if it was able to read a UInt32 from the input
Returns true if it was able to read a Int64 from the input
Returns true if it was able to read a UInt64 from the input
Returns true if it was able to read a Single from the input
Returns true if it was able to read a Double from the input
Provides decoding of bytes read from the input stream
Returns true if it was able to read a ByteString from the input
returns true if it was able to read a single value into the value reference. The value
stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap.
Creates a dictionary reader from an enumeration of KeyValuePair data, like an IDictionary
Constructs a FormUrlEncodedReader to parse form data, or url query text into a message.
Constructs a FormUrlEncodedReader to parse form data, or url query text into a message.
Constructs a FormUrlEncodedReader to parse form data, or url query text into a message.
Constructs a FormUrlEncodedReader to parse form data, or url query text into a message.
No-op
No-op
Merges the contents of stream into the provided message builder
Causes the reader to skip past this field
Peeks at the next field in the input stream and returns what information is available.
This may be called multiple times without actually reading the field. Only after the field
is either read, or skipped, should PeekNext return a different value.
Returns true if it was able to read a String from the input
It's unlikely this will work for anything but text data as bytes UTF8 are transformed to text and back to bytes
Not Supported
Not Supported
Extensions and helpers to abstract the reading/writing of messages by a client-specified content type.
Constructs an ICodedInputStream from the input stream based on the contentType provided
Options specific to reading this message and/or content type
The mime type of the input stream content
The stream to read the message from
The ICodedInputStream that can be given to the IBuilder.MergeFrom(...) method
Writes the message instance to the stream using the content type provided
Options specific to writing this message and/or content type
The mime type of the content to be written
The stream to write the message to
If you do not dispose of ICodedOutputStream some formats may yield incomplete output
A delegate used to specify a method that constructs an ICodedInputStream from a .NET Stream.
A delegate used to specify a method that constructs an ICodedOutputStream from a .NET Stream.
Defines control information for the various formatting used with HTTP services
The mime type for xml content
Other valid xml mime types include: application/binary, application/x-protobuf
The mime type for xml content
Other valid xml mime types include: text/xml
The mime type for json content
Other valid json mime types include: application/json, application/x-json,
application/x-javascript, text/javascript, text/x-javascript, text/x-json, text/json
The mime type for query strings and x-www-form-urlencoded content
This mime type is input-only
Default mime-type handling for input
Default mime-type handling for output
Provides access to modify the mime-type input stream construction
Provides access to modify the mime-type input stream construction
The default content type to use if the input type is null or empty. If this
value is not supplied an ArgumentOutOfRangeException exception will be raised.
The extension registry to use when reading messages
The name of the xml root element when reading messages
Xml reader options
True to use formatted output including new-lines and default indentation
The name of the xml root element when writing messages
Xml writer options
Provides a base class for text writers
Provides a base class for writers that performs some basic type dispatching
Completes any pending write operations
Writes the message to the the formatted stream.
Used to write any nessary root-message preamble. After this call you can call
IMessageLite.MergeTo(...) and complete the message with a call to WriteMessageEnd().
These three calls are identical to just calling WriteMessage(message);
AbstractWriter writer;
writer.WriteMessageStart();
message.WriteTo(writer);
writer.WriteMessageEnd();
// ... or, but not both ...
writer.WriteMessage(message);
Used to complete a root-message previously started with a call to WriteMessageStart()
Writes a Boolean value
Writes a Int32 value
Writes a UInt32 value
Writes a Int64 value
Writes a UInt64 value
Writes a Single value
Writes a Double value
Writes a String value
Writes a set of bytes
Writes a message or group as a field
Writes a System.Enum by the numeric and textual value
Writes a field of the type determined by field.FieldType
Writes an array of field values
Writes a numeric unknown field of wire type: Fixed32, Fixed64, or Variant
Writes an unknown field, Expect WireType of GroupStart or LengthPrefix
Encodes raw bytes to be written to the stream
Writes a typed field as a text value
Writes a String value
Writes a Boolean value
Writes a Int32 value
Writes a UInt32 value
Writes a Int64 value
Writes a UInt64 value
Writes a Single value
Writes a Double value
Writes a set of bytes
Writes a System.Enum by the numeric and textual value
Allows reading messages from a name/value dictionary
Creates a dictionary reader from an enumeration of KeyValuePair data, like an IDictionary
No-op
No-op
Merges the contents of stream into the provided message builder
Peeks at the next field in the input stream and returns what information is available.
This may be called multiple times without actually reading the field. Only after the field
is either read, or skipped, should PeekNext return a different value.
Causes the reader to skip past this field
Returns true if it was able to read a Boolean from the input
Returns true if it was able to read a Int32 from the input
Returns true if it was able to read a UInt32 from the input
Returns true if it was able to read a Int64 from the input
Returns true if it was able to read a UInt64 from the input
Returns true if it was able to read a Single from the input
Returns true if it was able to read a Double from the input
Returns true if it was able to read a String from the input
Returns true if it was able to read a ByteString from the input
returns true if it was able to read a single value into the value reference. The value
stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap.
Merges the input stream into the provided IBuilderLite
Allows writing messages to a name/value dictionary
Constructs a writer using a new dictionary
Constructs a writer using an existing dictionary
Creates the dictionary instance for a child message.
Accesses the dictionary that is backing this writer
Writes the message to the the formatted stream.
No-op
No-op
Writes a Boolean value
Writes a Int32 value
Writes a UInt32 value
Writes a Int64 value
Writes a UInt64 value
Writes a Single value
Writes a Double value
Writes a String value
Writes a set of bytes
Writes a message or group as a field
Writes a System.Enum by the numeric and textual value
Writes an array of field values
JsonFormatReader is used to parse Json into a message or an array of messages
Constructs a JsonFormatReader to parse Json into a message, this method does not use text encoding, all bytes MUST
represent ASCII character values.
Constructs a JsonFormatReader to parse Json into a message, this method does not use text encoding, all bytes MUST
represent ASCII character values.
Constructs a JsonFormatReader to parse Json into a message
Constructs a JsonFormatReader to parse Json into a message
Constructs a JsonFormatReader to parse Json into a message
Constructs a JsonFormatReader to parse Json into a message
Returns an enumerator that is used to cursor over an array of messages
This is generally used when receiving an array of messages rather than a single root message
Reads the root-message preamble specific to this formatter
Reads the root-message close specific to this formatter
Merges the contents of stream into the provided message builder
Causes the reader to skip past this field
Peeks at the next field in the input stream and returns what information is available.
This may be called multiple times without actually reading the field. Only after the field
is either read, or skipped, should PeekNext return a different value.
Returns true if it was able to read a String from the input
Returns true if it was able to read a ByteString from the input
Cursors through the array elements and stops at the end of the array
Merges the input stream into the provided IBuilderLite
Returns true if the reader is currently on an array element
JsonFormatWriter is a .NET 2.0 friendly json formatter for proto buffer messages. For .NET 3.5
you may also use the XmlFormatWriter with an XmlWriter created by the
JsonReaderWriterFactory.
Constructs a JsonFormatWriter, use the ToString() member to extract the final Json on completion.
Constructs a JsonFormatWriter, use ToString() to extract the final output
Constructs a JsonFormatWriter to output to the given text writer
Constructs a JsonFormatWriter to output to the given stream
Write to the output stream
Write to the output stream
Write to the output stream
Write to the output stream
Sets the output formatting to use Environment.NewLine with 4-character indentions
Writes a String value
Writes a Double value
Writes a Single value
Writes an array of field values
Writes a message
Writes the message to the the formatted stream.
Used to write the root-message preamble, in json this is the left-curly brace '{'.
After this call you can call IMessageLite.MergeTo(...) and complete the message with
a call to WriteMessageEnd().
Used to complete a root-message previously started with a call to WriteMessageStart()
Used to write an array of messages as the output rather than a single message.
using(writer.StartArray())
foreach(IMessageLite m in messages)
writer.WriteMessage(m);
Gets or sets the characters to use for the new-line, default = empty
Gets or sets the text to use for indenting, default = empty
Gets or sets the whitespace to use to separate the text, default = empty
Returns the output of TextWriter.ToString() where TextWriter is the ctor argument.
Used in streaming arrays of objects to the writer
using(writer.StartArray())
foreach(IMessageLite m in messages)
writer.WriteMessage(m);
Causes the end of the array character to be written.
JSon Tokenizer used by JsonFormatReader
Returns the next character without actually 'reading' it
Reads the next character in the input
The exception raised when a recursion limit is reached while parsing input.
Parses a proto buffer from an XML document or fragment. .NET 3.5 users may also
use this class to process Json by setting the options to support Json and providing
an XmlReader obtained from .
Constructs the XmlFormatReader using the stream provided as the xml
Constructs the XmlFormatReader using the stream provided as the xml
Constructs the XmlFormatReader using the string provided as the xml to be read
Constructs the XmlFormatReader using the xml in the TextReader
Constructs the XmlFormatReader with the XmlReader
Constructs the XmlFormatReader with the XmlReader and options
Sets the options to use while generating the XML
Reads the root-message preamble specific to this formatter
Reads the root-message preamble specific to this formatter
Reads the root-message close specific to this formatter, MUST be called
on the reader obtained from ReadMessageStart(string element).
Merge the provided builder as an element named in the current context
Merge the provided builder as an element of the current context
Merge the provided builder as an element of the current context
Peeks at the next field in the input stream and returns what information is available.
This may be called multiple times without actually reading the field. Only after the field
is either read, or skipped, should PeekNext return a different value.
Causes the reader to skip past this field
returns true if it was able to read a single value into the value reference. The value
stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap.
Returns true if it was able to read a String from the input
Merges the input stream into the provided IBuilderLite
Cursors through the array elements and stops at the end of the array
Gets or sets the options to use when reading the xml
Gets or sets the default element name to use when using the Merge<TBuilder>()
Writes a proto buffer to an XML document or fragment. .NET 3.5 users may also
use this class to produce Json by setting the options to support Json and providing
an XmlWriter obtained from .
Constructs the XmlFormatWriter to write to the given TextWriter
Constructs the XmlFormatWriter to write to the given stream
Constructs the XmlFormatWriter to write to the given stream
Constructs the XmlFormatWriter to write to the given XmlWriter
Sets the options to use while generating the XML
Completes any pending write operations
Used to write the root-message preamble, in xml this is open element for RootElementName,
by default "<root>". After this call you can call IMessageLite.MergeTo(...) and
complete the message with a call to WriteMessageEnd().
Used to write the root-message preamble, in xml this is open element for elementName.
After this call you can call IMessageLite.MergeTo(...) and complete the message with
a call to WriteMessageEnd().
Used to complete a root-message previously started with a call to WriteMessageStart()
Writes a message as an element using the name defined in
Writes a message as an element with the given name
Writes a message
Writes a String value
Writes an array of field values
Writes a System.Enum by the numeric and textual value
Gets or sets the default element name to use when using the Merge<TBuilder>()
Gets or sets the options to use while generating the XML
Options available for the xml reader output
Simple xml formatting with no attributes
Requires that arrays items are nested in an <item> element
Options available for the xml writer output
Simple xml formatting with no attributes
Writes the 'value' attribute on all enumerations with the numeric identifier
Embeds array items into child <item> elements
Outputs the 'type' attribute for compatibility with the JsonReaderWriterFactory
This option must, by nessessity, also enable NestedArrayItems