protobuf-net.Core
Provides support for common .NET types that do not have a direct representation
in protobuf, using the definitions from bcl.proto
Creates a new instance of the specified type, bypassing the constructor.
The type to create
The new instance
Writes a TimeSpan to a protobuf stream using protobuf-net's own representation, bcl.TimeSpan
Writes a TimeSpan to a protobuf stream using protobuf-net's own representation, bcl.TimeSpan
Parses a TimeSpan from a protobuf stream using protobuf-net's own representation, bcl.TimeSpan
Parses a TimeSpan from a protobuf stream using protobuf-net's own representation, bcl.TimeSpan
Parses a TimeSpan from a protobuf stream using the standardized format, google.protobuf.Duration
Parses a TimeSpan from a protobuf stream using the standardized format, google.protobuf.Duration
Writes a TimeSpan to a protobuf stream using the standardized format, google.protobuf.Duration
Writes a TimeSpan to a protobuf stream using the standardized format, google.protobuf.Duration
Parses a DateTime from a protobuf stream using the standardized format, google.protobuf.Timestamp
Parses a DateTime from a protobuf stream using the standardized format, google.protobuf.Timestamp
Writes a DateTime to a protobuf stream using the standardized format, google.protobuf.Timestamp
Writes a DateTime to a protobuf stream using the standardized format, google.protobuf.Timestamp
Parses a DateTime from a protobuf stream
Parses a DateTime from a protobuf stream
Writes a DateTime to a protobuf stream, excluding the Kind
Writes a DateTime to a protobuf stream, excluding the Kind
Writes a DateTime to a protobuf stream, including the Kind
Writes a DateTime to a protobuf stream, including the Kind
Parses a decimal from a protobuf stream
Parses a decimal from a protobuf stream
Parses a decimal from a protobuf stream
Writes a decimal to a protobuf stream
Writes a decimal to a protobuf stream
Writes a decimal to a protobuf stream
Writes a Guid to a protobuf stream
Writes a Guid to a protobuf stream
Writes a Guid to a protobuf stream
Writes a Guid to a protobuf stream
Parses a Guid from a protobuf stream
Parses a Guid from a protobuf stream
Parses a Guid from a protobuf stream
Parses a Guid from a protobuf stream
Provides a simple buffer-based implementation of an extension object.
Specifies a method on the root-contract in an hierarchy to be invoked before serialization.
Specifies a method on the root-contract in an hierarchy to be invoked after serialization.
Specifies a method on the root-contract in an hierarchy to be invoked before deserialization.
Specifies a method on the root-contract in an hierarchy to be invoked after deserialization.
Defines the compatibility level / conventions to use when encoding common
types into protobuf. When starting a new green-field project the highest
available level can be safely applied, but note that changing the
compatibility level changes the encoding. For this reason, it should not
be casually changed on brown-field projects, unless you are also knowingly
breaking the encoding requirements of pre-existing data. If not specified,
the oldest (lowest number) is assumed, for safety.
Functionally identical to
Uses bcl.proto for , , and , for compatibility
with all versions of protobuf-net, at the expense of being inconvenient for use with other protobuf implementations.
Like , but uses '.google.protobuf.Timestamp' for and '.google.protobuf.Duration' for .
This is functionally identical to a configuration that specifies .
Like , but uses 'string' for (big-endian hyphenated UUID format; a shorter 'bytes' variant is also available via )
and (invariant "general" format).
Defines the compatibiltiy level to use for an element
The compatibiltiy level to use for this element
Create a new CompatibilityLevelAttribute instance
Sub-format to use when serializing/deserializing data
Uses the default encoding for the data-type.
When applied to signed integer-based data (including Decimal), this
indicates that zigzag variant encoding will be used. This means that values
with small magnitude (regardless of sign) take a small amount
of space to encode.
When applied to signed integer-based data (including Decimal), this
indicates that two's-complement variant encoding will be used.
This means that any -ve number will take 10 bytes (even for 32-bit),
so should only be used for compatibility.
When applied to signed integer-based data (including Decimal), this
indicates that a fixed amount of space will be used.
When applied to a sub-message, indicates that the value should be treated
as group-delimited.
When applied to members of types such as DateTime or TimeSpan, specifies
that the "well known" standardized representation should be use; DateTime uses Timestamp,
TimeSpan uses Duration.
Represent multiple types as a union; this is used as part of OneOf -
note that it is the caller's responsbility to only read/write the value as the same type
The value typed as Object
Indicates whether the specified discriminator is assigned
Create a new discriminated union value
Reset a value if the specified discriminator is assigned
The discriminator value
Represent multiple types as a union; this is used as part of OneOf -
note that it is the caller's responsbility to only read/write the value as the same type
The value typed as Int64
The value typed as UInt64
The value typed as Int32
The value typed as UInt32
The value typed as Boolean
The value typed as Single
The value typed as Double
The value typed as DateTime
The value typed as TimeSpan
Indicates whether the specified discriminator is assigned
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Reset a value if the specified discriminator is assigned
The discriminator value
Represent multiple types as a union; this is used as part of OneOf -
note that it is the caller's responsbility to only read/write the value as the same type
The value typed as Int64
The value typed as UInt64
The value typed as Int32
The value typed as UInt32
The value typed as Boolean
The value typed as Single
The value typed as Double
The value typed as DateTime
The value typed as TimeSpan
The value typed as Guid
The value typed as Object
Indicates whether the specified discriminator is assigned
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Reset a value if the specified discriminator is assigned
The discriminator value
Represent multiple types as a union; this is used as part of OneOf -
note that it is the caller's responsbility to only read/write the value as the same type
The value typed as Int64
The value typed as UInt64
The value typed as Int32
The value typed as UInt32
The value typed as Boolean
The value typed as Single
The value typed as Double
The value typed as DateTime
The value typed as TimeSpan
The value typed as Guid
Indicates whether the specified discriminator is assigned
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Reset a value if the specified discriminator is assigned
The discriminator value
Represent multiple types as a union; this is used as part of OneOf -
note that it is the caller's responsbility to only read/write the value as the same type
The value typed as Int64
The value typed as UInt64
The value typed as Int32
The value typed as UInt32
The value typed as Boolean
The value typed as Single
The value typed as Double
The value typed as DateTime
The value typed as TimeSpan
The value typed as Object
Indicates whether the specified discriminator is assigned
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Reset a value if the specified discriminator is assigned
The discriminator value
Represent multiple types as a union; this is used as part of OneOf -
note that it is the caller's responsbility to only read/write the value as the same type
The value typed as Int32
The value typed as UInt32
The value typed as Boolean
The value typed as Single
Indicates whether the specified discriminator is assigned
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Reset a value if the specified discriminator is assigned
The discriminator value
Represent multiple types as a union; this is used as part of OneOf -
note that it is the caller's responsbility to only read/write the value as the same type
The value typed as Int32
The value typed as UInt32
The value typed as Boolean
The value typed as Single
The value typed as Object
Indicates whether the specified discriminator is assigned
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Create a new discriminated union value
Reset a value if the specified discriminator is assigned
The discriminator value
Simple base class for supporting unexpected fields allowing
for loss-less round-tips/merge, even if the data is not understod.
The additional fields are (by default) stored in-memory in a buffer.
As an example of an alternative implementation, you might
choose to use the file system (temporary files) as the back-end, tracking
only the paths [such an object would ideally be IDisposable and use
a finalizer to ensure that the files are removed].
Retrieves the extension object for the current
instance, optionally creating it if it does not already exist.
Should a new extension object be
created if it does not already exist?
The extension object if it exists (or was created), or null
if the extension object does not exist or is not available.
The createIfMissing argument is false during serialization,
and true during deserialization upon encountering unexpected fields.
Provides a simple, default implementation for extension support,
optionally creating it if it does not already exist. Designed to be called by
classes implementing .
Should a new extension object be
created if it does not already exist?
The that holds the fields, in terms of the inheritance model; the same tag key can appear against different type levels for the same instance, with different values.
The extension field to check (and possibly update).
The extension object if it exists (or was created), or null
if the extension object does not exist or is not available.
The createIfMissing argument is false during serialization,
and true during deserialization upon encountering unexpected fields.
Provides a simple, default implementation for extension support,
optionally creating it if it does not already exist. Designed to be called by
classes implementing .
Should a new extension object be
created if it does not already exist?
The extension field to check (and possibly update).
The extension object if it exists (or was created), or null
if the extension object does not exist or is not available.
The createIfMissing argument is false during serialization,
and true during deserialization upon encountering unexpected fields.
Appends the value as an additional (unexpected) data-field for the instance.
Note that for non-repeated sub-objects, this equates to a merge operation;
for repeated sub-objects this adds a new instance to the set; for simple
values the new value supercedes the old value.
Note that appending a value does not remove the old value from
the stream; avoid repeatedly appending values for the same field.
The type of the value to append.
The extensible object to append the value to.
The field identifier; the tag should not be defined as a known data-field for the instance.
The value to append.
Appends the value as an additional (unexpected) data-field for the instance.
Note that for non-repeated sub-objects, this equates to a merge operation;
for repeated sub-objects this adds a new instance to the set; for simple
values the new value supercedes the old value.
Note that appending a value does not remove the old value from
the stream; avoid repeatedly appending values for the same field.
The data-type of the field.
The data-format to use when encoding the value.
The extensible object to append the value to.
The field identifier; the tag should not be defined as a known data-field for the instance.
The value to append.
Appends the value as an additional (unexpected) data-field for the instance.
Note that for non-repeated sub-objects, this equates to a merge operation;
for repeated sub-objects this adds a new instance to the set; for simple
values the new value supercedes the old value.
Note that appending a value does not remove the old value from
the stream; avoid repeatedly appending values for the same field.
The data-type of the field.
The data-format to use when encoding the value.
The model to use for serialization.
The extensible object to append the value to.
The field identifier; the tag should not be defined as a known data-field for the instance.
The value to append.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned is the composed value after merging any duplicated content; if the
value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The effective value of the field, or the default value if not found.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned is the composed value after merging any duplicated content; if the
value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
The effective value of the field, or the default value if not found.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned is the composed value after merging any duplicated content; if the
value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The type model to use for deserialization.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
The effective value of the field, or the default value if not found.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned (in "value") is the composed value after merging any duplicated content;
if the value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The effective value of the field, or the default value if not found.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
True if data for the field was present, false otherwise.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned (in "value") is the composed value after merging any duplicated content;
if the value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The effective value of the field, or the default value if not found.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
True if data for the field was present, false otherwise.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned (in "value") is the composed value after merging any duplicated content;
if the value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The effective value of the field, or the default value if not found.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
Allow tags that are present as part of the definition; for example, to query unknown enum values.
True if data for the field was present, false otherwise.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned (in "value") is the composed value after merging any duplicated content;
if the value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The effective value of the field, or the default value if not found.
The extensible object to obtain the value from.
The type model to use for deserialization.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
Allow tags that are present as part of the definition; for example, to query unknown enum values.
True if data for the field was present, false otherwise.
Queries an extensible object for an additional (unexpected) data-field for the instance.
Each occurrence of the field is yielded separately, making this usage suitable for "repeated"
(list) fields.
The extended data is processed lazily as the enumerator is iterated.
The data-type of the field.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
An enumerator that yields each occurrence of the field.
Queries an extensible object for an additional (unexpected) data-field for the instance.
Each occurrence of the field is yielded separately, making this usage suitable for "repeated"
(list) fields.
The extended data is processed lazily as the enumerator is iterated.
The data-type of the field.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
An enumerator that yields each occurrence of the field.
Queries an extensible object for an additional (unexpected) data-field for the instance.
Each occurrence of the field is yielded separately, making this usage suitable for "repeated"
(list) fields.
The extended data is processed lazily as the enumerator is iterated.
The data-type of the field.
The extensible object to obtain the value from.
The type model to use for deserialization.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
An enumerator that yields each occurrence of the field.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned (in "value") is the composed value after merging any duplicated content;
if the value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The model to use for configuration.
The effective value of the field, or the default value if not found.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
Allow tags that are present as part of the definition; for example, to query unknown enum values.
True if data for the field was present, false otherwise.
Queries an extensible object for an additional (unexpected) data-field for the instance.
Each occurrence of the field is yielded separately, making this usage suitable for "repeated"
(list) fields.
The extended data is processed lazily as the enumerator is iterated.
The model to use for configuration.
The data-type of the field.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
An enumerator that yields each occurrence of the field.
Appends the value as an additional (unexpected) data-field for the instance.
Note that for non-repeated sub-objects, this equates to a merge operation;
for repeated sub-objects this adds a new instance to the set; for simple
values the new value supercedes the old value.
Note that appending a value does not remove the old value from
the stream; avoid repeatedly appending values for the same field.
The model to use for configuration.
The data-format to use when encoding the value.
The extensible object to append the value to.
The field identifier; the tag should not be defined as a known data-field for the instance.
The value to append.
This class acts as an internal wrapper allowing us to do a dynamic
methodinfo invoke; an't put into Serializer as don't want on public
API; can't put into Serializer<T> since we need to invoke
across classes
All this does is call GetExtendedValuesTyped with the correct type for "instance";
this ensures that we don't get issues with subclasses declaring conflicting types -
the caller must respect the fields defined for the type they pass in.
All this does is call GetExtendedValuesTyped with the correct type for "instance";
this ensures that we don't get issues with subclasses declaring conflicting types -
the caller must respect the fields defined for the type they pass in.
Not all frameworks are created equal (fx1.1 vs fx2.0,
micro-framework, compact-framework,
silverlight, etc). This class simply wraps up a few things that would
otherwise make the real code unnecessarily messy, providing fallback
implementations if necessary.
Intended to be a direct map to regular TypeCode, but:
- with missing types
- existing on WinRT
Indicates that the implementing type has support for protocol-buffer
extensions.
Can be implemented by deriving from Extensible.
Retrieves the extension object for the current
instance, optionally creating it if it does not already exist.
Should a new extension object be
created if it does not already exist?
The extension object if it exists (or was created), or null
if the extension object does not exist or is not available.
The createIfMissing argument is false during serialization,
and true during deserialization upon encountering unexpected fields.
Indicates that the implementing type has support for protocol-buffer
extensions at multiple inheritance levels.
Can be implemented by deriving from Extensible.
Retrieves the extension object for the current
instance, optionally creating it if it does not already exist.
Should a new extension object be
created if it does not already exist?
The that holds the fields, in terms of the inheritance model; the same tag key can appear against different type levels for the same instance, with different values.
The extension object if it exists (or was created), or null
if the extension object does not exist or is not available.
The createIfMissing argument is false during serialization,
and true during deserialization upon encountering unexpected fields.
Provides addition capability for supporting unexpected fields during
protocol-buffer serialization/deserialization. This allows for loss-less
round-trip/merge, even when the data is not fully understood.
Requests a stream into which any unexpected fields can be persisted.
A new stream suitable for storing data.
Indicates that all unexpected fields have now been stored. The
implementing class is responsible for closing the stream. If
"commit" is not true the data may be discarded.
The stream originally obtained by BeginAppend.
True if the append operation completed successfully.
Requests a stream of the unexpected fields previously stored.
A prepared stream of the unexpected fields.
Indicates that all unexpected fields have now been read. The
implementing class is responsible for closing the stream.
The stream originally obtained by BeginQuery.
Requests the length of the raw binary stream; this is used
when serializing sub-entities to indicate the expected size.
The length of the binary stream representing unexpected data.
Provides the ability to remove all existing extension data
Remove all existing extension data
Specifies the method used to infer field tags for members of the type
under consideration. Tags are deduced using the invariant alphabetic
sequence of the members' names; this makes implicit field tags very brittle,
and susceptible to changes such as field names (normally an isolated
change).
No members are serialized implicitly; all members require a suitable
attribute such as [ProtoMember]. This is the recmomended mode for
most scenarios.
Public properties and fields are eligible for implicit serialization;
this treats the public API as a contract. Ordering beings from ImplicitFirstTag.
Public and non-public fields are eligible for implicit serialization;
this acts as a state/implementation serializer. Ordering beings from ImplicitFirstTag.
Provides access to the inner fields of a decimal.
Similar to decimal.GetBits(), but faster and avoids the int[] allocation
Provides access to the inner fields of a Guid.
Similar to Guid.ToByteArray(), but faster and avoids the byte[] allocation
Indicates whether a value is non-null and needs serialization (non-zero, not an empty string, etc)
Indicates whether a value is null
Represents the ability to deserialize values from an input of type
Deserialize a value from the input
Represents the ability to serialize values to an output of type
Serialize the provided value
Represents the ability to serialize values to an output of type
with pre-computation of the length
Measure the length of a value in advance of serialization
Serialize the previously measured value
Represents common state during a serialization operation; this instance should not be stored - it may be reused later with different meaning
The type-model that represents the operation
Addition information about this serialization operation.
Represents the outcome of computing the length of an object; since this may have required computing lengths
for multiple objects, some metadata is retained so that a subsequent serialize operation using
this instance can re-use the previously calculated lengths. If the object state changes between the
measure and serialize operations, the behavior is undefined.
Releases all resources associated with this value
Gets the calculated length of this serialize operation, in bytes
Returns the calculated length, disposing the value as a side-effect
Perform the calculated serialization operation against the provided target stream. If the object state changes between the
measure and serialize operations, the behavior is undefined.
Perform the calculated serialization operation against the provided target writer. If the object state changes between the
measure and serialize operations, the behavior is undefined.
Indiate the variant of the protobuf .proto DSL syntax to use
Use the global default
https://developers.google.com/protocol-buffers/docs/proto
https://developers.google.com/protocol-buffers/docs/proto3
Options for controlling schema generation
Indiate the variant of the protobuf .proto DSL syntax to use
Additional flags to control schema generation
The package to use for generation (null to try to infer)
The services to consider as part of this operation.
The types to consider as part of this operation.
The file that defines this type (as used with import in .proto); when non-empty, only
types in the same Origin are included; this option is inferred if null.
Additional flags to control schema generation
No additional flags
Provide support for extended/multiple namespace details in schemas
Record the sub-type relationship formally in schemas
Describes a service.
The name of the service.
The methods available on the service.
Describes a method of a service.
The name of the method.
The type sent by the client.
The type returned from the server.
Identifies if server streams multiple server messages.
Identifies if client streams multiple client messages.
Event arguments needed to perform type-formatting functions; this could be resolving a Type to a string suitable for serialization, or could
be requesting a Type from a string. If no changes are made, a default implementation will be used (from the assembly-qualified names).
The type involved in this map; if this is initially null, a Type is expected to be provided for the string in FormattedName.
The formatted-name involved in this map; if this is initially null, a formatted-name is expected from the type in Type.
Delegate type used to perform type-formatting functions; the sender originates as the type-model.
Provides protobuf serialization support for a number of types
Gets or sets the buffer-size to use when writing messages via
Gets or sets the max serialization/deserialization depth
Gets a cached serializer for a type, as offered by a given provider
Specifies optional behaviors associated with a type model
No additional options
Should the deserializer attempt to avoid duplicate copies of the same string?
Should the Kind be included on date/time values?
Should zero-length packed arrays be serialized? (this is the v2 behavior, but skipping them is more efficient)
Should root-values allow "packed" encoding? (v2 does not support this)
Specifies optional behaviors associated with this model
Resolve a System.Type to the compiler-specific type
Resolve a System.Type to the compiler-specific type
Indicates whether a type is known to the model
This is the more "complete" version of Serialize, which handles single instances of mapped types.
The value is written as a complete field, including field-header and (for sub-objects) a
length-prefix
In addition to that, this provides support for:
- basic values; individual int / string / Guid / etc
- IEnumerable sequences of any type handled by TrySerializeAuxiliaryType
Writes a protocol-buffer representation of the given instance to the supplied stream.
The existing instance to be serialized (cannot be null).
The destination stream to write to.
Writes a protocol-buffer representation of the given instance to the supplied stream.
The existing instance to be serialized (cannot be null).
The destination stream to write to.
Additional information about this serialization operation.
Writes a protocol-buffer representation of the given instance to the supplied writer.
The existing instance to be serialized (cannot be null).
The destination stream to write to.
Additional information about this serialization operation.
Writes a protocol-buffer representation of the given instance to the supplied stream.
The existing instance to be serialized (cannot be null).
The destination stream to write to.
Additional information about this serialization operation.
Writes a protocol-buffer representation of the given instance to the supplied writer.
The existing instance to be serialized (cannot be null).
The destination stream to write to.
Additional information about this serialization operation.
Calculates the length of a protocol-buffer payload for an item
Writes a protocol-buffer representation of the given instance to the supplied writer.
The existing instance to be serialized (cannot be null).
The destination writer to write to.
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed
data - useful with network IO.
The type being merged.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
How to encode the length prefix.
The tag used as a prefix to each record (only used with base-128 style prefixes).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed
data - useful with network IO.
The type being merged.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
How to encode the length prefix.
The tag used as a prefix to each record (only used with base-128 style prefixes).
Used to resolve types on a per-field basis.
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed
data - useful with network IO.
The type being merged.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
How to encode the length prefix.
The tag used as a prefix to each record (only used with base-128 style prefixes).
Used to resolve types on a per-field basis.
Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed
data - useful with network IO.
The type being merged.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
How to encode the length prefix.
The tag used as a prefix to each record (only used with base-128 style prefixes).
Used to resolve types on a per-field basis.
Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Reads a sequence of consecutive length-prefixed items from a stream, using
either base-128 or fixed-length prefixes. Base-128 prefixes with a tag
are directly comparable to serializing multiple items in succession
(use the tag to emulate the implicit behavior
when serializing a list/array). When a tag is
specified, any records with different tags are silently omitted. The
tag is ignored. The tag is ignores for fixed-length prefixes.
The binary stream containing the serialized records.
The prefix style used in the data.
The tag of records to return (if non-positive, then no tag is
expected and all records are returned).
On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified).
The type of object to deserialize (can be null if "resolver" is specified).
The sequence of deserialized objects.
Reads a sequence of consecutive length-prefixed items from a stream, using
either base-128 or fixed-length prefixes. Base-128 prefixes with a tag
are directly comparable to serializing multiple items in succession
(use the tag to emulate the implicit behavior
when serializing a list/array). When a tag is
specified, any records with different tags are silently omitted. The
tag is ignored. The tag is ignores for fixed-length prefixes.
The binary stream containing the serialized records.
The prefix style used in the data.
The tag of records to return (if non-positive, then no tag is
expected and all records are returned).
On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified).
The type of object to deserialize (can be null if "resolver" is specified).
The sequence of deserialized objects.
Additional information about this serialization operation.
Reads a sequence of consecutive length-prefixed items from a stream, using
either base-128 or fixed-length prefixes. Base-128 prefixes with a tag
are directly comparable to serializing multiple items in succession
(use the tag to emulate the implicit behavior
when serializing a list/array). When a tag is
specified, any records with different tags are silently omitted. The
tag is ignored. The tag is ignores for fixed-length prefixes.
The type of object to deserialize.
The binary stream containing the serialized records.
The prefix style used in the data.
The tag of records to return (if non-positive, then no tag is
expected and all records are returned).
The sequence of deserialized objects.
Reads a sequence of consecutive length-prefixed items from a stream, using
either base-128 or fixed-length prefixes. Base-128 prefixes with a tag
are directly comparable to serializing multiple items in succession
(use the tag to emulate the implicit behavior
when serializing a list/array). When a tag is
specified, any records with different tags are silently omitted. The
tag is ignored. The tag is ignores for fixed-length prefixes.
The type of object to deserialize.
The binary stream containing the serialized records.
The prefix style used in the data.
The tag of records to return (if non-positive, then no tag is
expected and all records are returned).
The sequence of deserialized objects.
Additional information about this serialization operation.
Writes a protocol-buffer representation of the given instance to the supplied stream,
with a length-prefix. This is useful for socket programming,
as DeserializeWithLengthPrefix can be used to read the single object back
from an ongoing stream.
The type being serialized.
The existing instance to be serialized (cannot be null).
How to encode the length prefix.
The destination stream to write to.
The tag used as a prefix to each record (only used with base-128 style prefixes).
Writes a protocol-buffer representation of the given instance to the supplied stream,
with a length-prefix. This is useful for socket programming,
as DeserializeWithLengthPrefix can be used to read the single object back
from an ongoing stream.
The type being serialized.
The existing instance to be serialized (cannot be null).
How to encode the length prefix.
The destination stream to write to.
The tag used as a prefix to each record (only used with base-128 style prefixes).
Additional information about this serialization operation.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Additional information about this serialization operation.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The number of bytes to consider (no limit if omitted).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
Additional information about this serialization operation.
The binary stream to apply to the instance (cannot be null).
The existing instance to be modified (can be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
The number of bytes to consume.
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
The number of bytes to consume.
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
The number of bytes to consume (or -1 to read to the end of the stream).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Additional information about this serialization operation.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary stream to apply to the instance (cannot be null).
The number of bytes to consume (or -1 to read to the end of the stream).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Additional information about this serialization operation.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary payload to apply to the instance.
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Additional information about this serialization operation.
Applies a protocol-buffer stream to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The binary payload to apply to the instance.
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Additional information about this serialization operation.
Applies a protocol-buffer reader to an existing instance (which may be null).
The type (including inheritance) to consider.
The existing instance to be modified (can be null).
The reader to apply to the instance (cannot be null).
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
This is the more "complete" version of Deserialize, which handles single instances of mapped types.
The value is read as a complete field, including field-header and (for sub-objects) a
length-prefix..kmc
In addition to that, this provides support for:
- basic values; individual int / string / Guid / etc
- IList sets of any type handled by TryDeserializeAuxiliaryType
Creates a new runtime model, to which the caller
can add support for a range of types. A model
can be used "as is", or can be compiled for
optimal performance.
Create a model that serializes all types from an
assembly specified by type
Create a model that serializes all types from an
assembly specified by type
Create a model that serializes all types from an assembly
Indicates whether the supplied type is explicitly modelled by the model
Indicates whether the supplied type is explicitly modelled by the model
Get a typed serializer for
Gets the inbuilt serializer relevant to a specific (and ).
Returns null if there is no defined inbuilt serializer.
Applies a protocol-buffer stream to an existing instance (which may be null).
Represents the type (including inheritance) to consider.
The existing instance to be modified (can be null).
Reader state
The style of serialization to adopt
The updated instance; this may be different to the instance argument if
either the original instance was null, or the stream defines a known sub-type of the
original instance.
Indicates the type of callback to be used
Invoked before an object is serialized
Invoked after an object is serialized
Invoked before an object is deserialized (or when a new instance is created)
Invoked after an object is deserialized
Create a deep clone of the supplied instance; any sub-items are also cloned.
Create a deep clone of the supplied instance; any sub-items are also cloned.
Indicates that while an inheritance tree exists, the exact type encountered was not
specified in that hierarchy and cannot be processed.
Indicates that while an inheritance tree exists, the exact type encountered was not
specified in that hierarchy and cannot be processed.
Indicates that while an inheritance tree exists, the exact type encountered was not
specified in that hierarchy and cannot be processed.
Returns whether the object provided is a subtype of the expected type
Indicates that the given type was not expected, and cannot be processed.
Indicates that the given type cannot be constructed; it may still be possible to
deserialize into existing instances.
Returns true if the type supplied is either a recognised contract type,
or a *list* of a recognised contract type.
Note that primitives always return false, even though the engine
will, if forced, try to serialize such
True if this type is recognised as a serializable entity, else false
Returns true if the type supplied is a basic type with inbuilt handling,
a recognised contract type, or a *list* of a basic / contract type.
Returns true if the type supplied is a basic type with inbuilt handling,
or a *list* of a basic type with inbuilt handling
Suggest a .proto definition for the given type
The type to generate a .proto definition for, or null to generate a .proto that represents the entire model
The .proto definition as a string
Suggest a .proto definition for the given type
The type to generate a .proto definition for, or null to generate a .proto that represents the entire model
The .proto definition as a string
The .proto syntax to use for the operation
Suggest a .proto definition for the given configuration
The .proto definition as a string
Options for schema generation
Used to provide custom services for writing and parsing type names when using dynamic types. Both parsing and formatting
are provided on a single API as it is essential that both are mapped identically at all times.
Creates a new IFormatter that uses protocol-buffer [de]serialization.
A new IFormatter to be used during [de]serialization.
The type of object to be [de]deserialized by the formatter.
The field number that is used as a default when serializing/deserializing a list of objects.
The data is treated as repeated message with field number 1.
Specifies the type of prefix that should be applied to messages.
No length prefix is applied to the data; the data is terminated only be the end of the stream.
A base-128 ("varint", the default prefix format in protobuf) length prefix is applied to the data (efficient for short messages).
A fixed-length (little-endian) length prefix is applied to the data (useful for compatibility).
A fixed-length (big-endian) length prefix is applied to the data (useful for compatibility).
Indicates that a type is defined for protocol-buffer serialization.
Gets or sets the defined name of the type. This can be fully qualified , for example .foo.bar.someType if required.
Gets or sets the file that defines this type (as used with import in .proto)
Gets or sets the fist offset to use with implicit field tags;
only uesd if ImplicitFields is set.
If specified, alternative contract markers (such as markers for XmlSerailizer or DataContractSerializer) are ignored.
If specified, do NOT treat this type as a list, even if it looks like one.
Gets or sets the mechanism used to automatically infer field tags
for members. This option should be used in advanced scenarios only.
Please review the important notes against the ImplicitFields enumeration.
Enables/disables automatic tag generation based on the existing name / order
of the defined members. This option is not used for members marked
with ProtoMemberAttribute, as intended to provide compatibility with
WCF serialization. WARNING: when adding new fields you must take
care to increase the Order for new elements, otherwise data corruption
may occur.
If not explicitly specified, the default is assumed from Serializer.GlobalOptions.InferTagFromName.
Has a InferTagFromName value been explicitly set? if not, the default from the type-model is assumed.
Specifies an offset to apply to [DataMember(Order=...)] markers;
this is useful when working with mex-generated classes that have
a different origin (usually 1 vs 0) than the original data-contract.
This value is added to the Order of each member.
If true, the constructor for the type is bypassed during deserialization, meaning any field initializers
or other initialization code is skipped.
Should this type be treated as a reference by default? Please also see the implications of this,
as recorded on ProtoMemberAttribute.AsReference
Indicates whether this type should always be treated as a "group" (rather than a string-prefixed sub-message)
Gets or sets a value indicating whether unknown sub-types should cause serialization failure
Applies only to enums (not to DTO classes themselves); gets or sets a value indicating that an enum should be treated directly as an int/short/etc, rather
than enforcing .proto enum rules. This is useful *in particul* for [Flags] enums.
Defines a surrogate type used for serialization/deserialization purpose.
Defines a serializer to use for this type; the serializer must implement ISerializer-T for this type
Indicates that a static member should be considered the same as though
were an implicit / explicit conversion operator; in particular, this
is useful for conversions that operator syntax does not allow, such as
to/from interface types.
Used to define protocol-buffer specific behavior for
enumerated values.
Gets or sets the specific value to use for this enum during serialization.
Indicates whether this instance has a customised value mapping
true if a specific value is set
Gets or sets the defined name of the enum, as used in .proto
(this name is not used during serialization).
Indicates an error during serialization/deserialization of a proto stream.
Creates a new ProtoException instance.
Creates a new ProtoException instance.
Creates a new ProtoException instance.
Creates a new ProtoException instance.
Indicates that a member should be excluded from serialization; this
is only normally used when using implict fields.
Indicates that a member should be excluded from serialization; this
is only normally used when using implict fields. This allows
ProtoIgnoreAttribute usage
even for partial classes where the individual members are not
under direct control.
Creates a new ProtoPartialIgnoreAttribute instance.
Specifies the member to be ignored.
The name of the member to be ignored.
Indicates the known-types to support for an individual
message. This serializes each level in the hierarchy as
a nested message to retain wire-compatibility with
other protocol-buffer implementations.
Creates a new instance of the ProtoIncludeAttribute.
The unique index (within the type) that will identify this data.
The additional type to serialize/deserialize.
Creates a new instance of the ProtoIncludeAttribute.
The unique index (within the type) that will identify this data.
The additional type to serialize/deserialize.
Gets the unique index (within the type) that will identify this data.
Gets the additional type to serialize/deserialize.
Gets the additional type to serialize/deserialize.
Specifies whether the inherited type's sub-message should be
written with a length-prefix (default), or with group markers.
Controls the formatting of elements in a dictionary, and indicates that
"map" rules should be used: duplicates *replace* earlier values, rather
than throwing an exception
Describes the data-format used to store the key
Describes the data-format used to store the value
Disables "map" handling; dictionaries will use ".Add(key,value)" instead of "[key] = value",
which means duplicate keys will cause an exception (instead of retaining the final value); if
a proto schema is emitted, it will be produced using "repeated" instead of "map"
Declares a member to be used in protocol-buffer serialization, using
the given Tag. A DataFormat may be used to optimise the serialization
format (for instance, using zigzag encoding for negative numbers, or
fixed-length encoding for large values.
Compare with another ProtoMemberAttribute for sorting purposes
Compare with another ProtoMemberAttribute for sorting purposes
Creates a new ProtoMemberAttribute instance.
Specifies the unique tag used to identify this member within the type.
Gets or sets the original name defined in the .proto; not used
during serialization.
Gets or sets the data-format to be used when encoding this value.
Gets the unique tag used to identify this member within the type.
Gets or sets a value indicating whether this member is mandatory.
Gets a value indicating whether this member is packed.
This option only applies to list/array data of primitive types (int, double, etc).
Indicates whether this field should *replace* existing values (the default is false, meaning *append*).
This option only applies to list/array data.
Enables full object-tracking/full-graph support.
Embeds the type information into the stream, allowing usage with types not known in advance.
Gets or sets a value indicating whether this member is packed (lists/arrays).
Additional (optional) settings that control serialization of members
Default; no additional options
Indicates that repeated elements should use packed (length-prefixed) encoding
Indicates that the given item is required
Enables full object-tracking/full-graph support
Embeds the type information into the stream, allowing usage with types not known in advance
Indicates whether this field should *replace* existing values (the default is false, meaning *append*).
This option only applies to list/array data.
Determines whether the types AsReferenceDefault value is used, or whether this member's AsReference should be used
Declares a member to be used in protocol-buffer serialization, using
the given Tag and MemberName. This allows ProtoMemberAttribute usage
even for partial classes where the individual members are not
under direct control.
A DataFormat may be used to optimise the serialization
format (for instance, using zigzag encoding for negative numbers, or
fixed-length encoding for large values.
Creates a new ProtoMemberAttribute instance.
Specifies the unique tag used to identify this member within the type.
Specifies the member to be serialized.
The name of the member to be serialized.
A stateful reader, used to read a protobuf stream. Typical usage would be (sequentially) to call
ReadFieldHeader and (after matching the field) an appropriate Read* method.
Gets the number of the field being processed.
Indicates the underlying proto serialization format on the wire.
Gets / sets a flag indicating whether strings should be checked for repetition; if
true, any repeated UTF-8 byte sequence will result in the same String instance, rather
than a second instance of the same string. Disabled by default. Note that this uses
a custom interner - the system-wide string interner is not used.
Initialize the reader
Addition information about this deserialization operation.
Addition information about this deserialization operation.
Releases resources used by the reader, but importantly does not Dispose the
underlying stream; in many typical use-cases the stream is used for different
processes, so it is assumed that the consumer will Dispose their stream separately.
Returns the position of the current reader (note that this is not necessarily the same as the position
in the underlying stream, if multiple readers are used on the same stream)
Returns the position of the current reader (note that this is not necessarily the same as the position
in the underlying stream, if multiple readers are used on the same stream)
Reads a signed 16-bit integer from the stream: Variant, Fixed32, Fixed64, SignedVariant
Reads an unsigned 16-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads an unsigned 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads a signed 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads an unsigned 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads a signed 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads a signed 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads a string from the stream (using UTF8); supported wire-types: String
Throws an exception indication that the given value cannot be mapped to an enum.
Reads a double-precision number from the stream; supported wire-types: Fixed32, Fixed64
Reads (merges) a sub-message from the stream, internally calling StartSubItem and EndSubItem, and (in between)
parsing the message in accordance with the model associated with the reader
Makes the end of consuming a nested message in the stream; the stream must be either at the correct EndGroup
marker, or all fields of the sub-message must have been consumed (in either case, this means ReadFieldHeader
should return zero)
Begins consuming a nested message in the stream; supported wire-types: StartGroup, String
The token returned must be help and used when callining EndSubItem
Reads a field header from the stream, setting the wire-type and retuning the field number. If no
more fields are available, then 0 is returned. This methods respects sub-messages.
Looks ahead to see whether the next field in the stream is what we expect
(typically; what we've just finished reading - for example ot read successive list items)
Get the TypeModel associated with this reader
Compares the streams current wire-type to the hinted wire-type, updating the reader if necessary; for example,
a Variant may be updated to SignedVariant. If the hinted wire-type is unrelated then no change is made.
Verifies that the stream's current wire-type is as expected, or a specialized sub-type (for example,
SignedVariant) - in which case the current wire-type is updated. Otherwise an exception is thrown.
Discards the data for the current field.
Reads an unsigned 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads a single-precision number from the stream; supported wire-types: Fixed32, Fixed64
Reads a boolean value from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads a byte-sequence from the stream, appending them to an existing byte-sequence (which can be null); supported wire-types: String
Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length
reader to be created.
Reads a little-endian encoded integer. An exception is thrown if the data is not all available.
Reads a big-endian encoded integer. An exception is thrown if the data is not all available.
Reads a varint encoded integer. An exception is thrown if the data is not all available.
Reads a string (of a given lenth, in bytes) directly from the source into a pre-existing buffer. An exception is thrown if the data is not all available.
Reads a given number of bytes directly from the source. An exception is thrown if the data is not all available.
Reads a string (of a given lenth, in bytes) directly from the source. An exception is thrown if the data is not all available.
Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length
reader to be created.
Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length
reader to be created.
Read a varint if possible
The number of bytes consumed; 0 if no data available
Copies the current field into the instance as extension data
Indicates whether the reader still has data remaining in the current sub-item,
additionally setting the wire-type for the next field if there is more data.
This is used when decoding packed data.
Reads a Type from the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String
Merge two objects using the details from the current reader; this is used to change the type
of objects when an inheritance relationship is discovered later than usual during deserilazation.
Holds state used by the deserializer
Creates a new reader against a multi-segment buffer
The source buffer
The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects
Additional context about this serialization operation
Creates a new reader against a multi-segment buffer
The source buffer
The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects
Additional context about this serialization operation
Release any resources associated with this instance
Reads an unsigned 16-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads a signed 16-bit integer from the stream: Variant, Fixed32, Fixed64, SignedVariant
Returns the position of the current reader (note that this is not necessarily the same as the position
in the underlying stream, if multiple readers are used on the same stream)
Reads an unsigned 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads a signed 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads an unsigned 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads a signed 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads a signed 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Reads a double-precision number from the stream; supported wire-types: Fixed32, Fixed64
Reads a single-precision number from the stream; supported wire-types: Fixed32, Fixed64
Reads a boolean value from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads an unsigned 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64
Reads a byte-sequence from the stream, appending them to an existing byte-sequence (which can be null); supported wire-types: String
Reads a byte-sequence from the stream, appending them to an existing byte-sequence; supported wire-types: String
Reads a byte-sequence from the stream, appending them to an existing byte-sequence; supported wire-types: String
Reads a byte-sequence from the stream, appending them to an existing byte-sequence; supported wire-types: String
Reads a byte-sequence from the stream, appending them to an existing byte-sequence (which can be null); supported wire-types: String
Tries to read a string-like type directly into a span; if successful, the span
returned indicates the available amount of data; if unsuccessful, an exception
is thrown; this should only be used when there is confidence that the length
is bounded.
Begins consuming a nested message in the stream; supported wire-types: StartGroup, String
The token returned must be help and used when callining EndSubItem
Makes the end of consuming a nested message in the stream; the stream must be either at the correct EndGroup
marker, or all fields of the sub-message must have been consumed (in either case, this means ReadFieldHeader
should return zero)
Reads (merges) a sub-message from the stream, internally calling StartSubItem and EndSubItem, and (in between)
parsing the message in accordance with the model associated with the reader
Reads a string from the stream (using UTF8); supported wire-types: String
Verifies that the stream's current wire-type is as expected, or a specialized sub-type (for example,
SignedVariant) - in which case the current wire-type is updated. Otherwise an exception is thrown.
Discards the data for the current field.
Reads a field header from the stream, setting the wire-type and retuning the field number. If no
more fields are available, then 0 is returned. This methods respects sub-messages.
Looks ahead to see whether the next field in the stream is what we expect
(typically; what we've just finished reading - for example ot read successive list items)
Compares the streams current wire-type to the hinted wire-type, updating the reader if necessary; for example,
a Variant may be updated to SignedVariant. If the hinted wire-type is unrelated then no change is made.
Throws an exception indication that the given value cannot be mapped to an enum.
Copies the current field into the instance as extension data
Copies the current field into the instance as extension data
Indicates the underlying proto serialization format on the wire.
Gets / sets a flag indicating whether strings should be checked for repetition; if
true, any repeated UTF-8 byte sequence will result in the same String instance, rather
than a second instance of the same string. Disabled by default. Note that this uses
a custom interner - the system-wide string interner is not used.
Gets the number of the field being processed.
Reads a Type from the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String
Reads a sub-item from the input reader
Reads a sub-item from the input reader
Reads a sub-item from the input reader
Reads a value or sub-item from the input reader
Reads a value or sub-item from the input reader
Gets the serializer associated with a specific type
Reads a sub-item from the input reader
Deserialize an instance of the provided type
Gets the serialization context associated with this instance;
Indicates whether the reader still has data remaining in the current sub-item,
additionally setting the wire-type for the next field if there is more data.
This is used when decoding packed data.
Create an instance of the provided type, respecting any custom factory rules
Creates a new reader against a stream
The source stream
The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects
Additional context about this serialization operation
The number of bytes to read, or -1 to read until the end of the stream
Get the default state associated with this reader
Creates a new reader against a stream
The source stream
The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects
Additional context about this serialization operation
The number of bytes to read, or -1 to read until the end of the stream
Creates a new reader against a stream
The source stream
The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects
Additional context about this serialization operation
The number of bytes to read, or -1 to read until the end of the stream
Creates a new reader against a stream
The source stream
The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects
Additional context about this serialization operation
The number of bytes to read, or -1 to read until the end of the stream
Creates a new reader against a stream
The source stream
The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects
Additional context about this serialization operation
Indicates a reserved field or range
The start of a numeric field range
The end of a numeric field range
A named field reservation
Creates a new instance of a single number field reservation
Creates a new instance of a range number field reservation
Records a comment explaining this reservation
Creates a new instance of a named field reservation
Represents an output stream for writing protobuf data.
Why is the API backwards (static methods with writer arguments)?
See: http://marcgravell.blogspot.com/2010/03/last-will-be-first-and-first-will-be.html
Writer state
Create a new ProtoWriter that tagets a buffer writer
Writes any uncommitted data to the output
Writes a string to the stream
Writes a string to the stream; supported wire-types: String
Writes a Type to the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String
Writes a field-header, indicating the format of the next data we plan to write.
Writes a signed 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes a signed 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes a signed 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes a signed 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes an unsigned 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes a boolean to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes a double-precision number to the stream; supported wire-types: Fixed32, Fixed64
Writes a single-precision number to the stream; supported wire-types: Fixed32, Fixed64
Writes a signed 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes an unsigned 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes a sub-item to the writer
Writes a sub-item to the writer
Writes a sub-item to the writer
Writes a value or sub-item to the writer
Writes a value or sub-item to the writer
Writes a sub-type to the input writer
Writes a sub-type to the input writer
Writes a base-type to the input writer
Gets the serializer associated with a specific type
The serialization context associated with this instance
Writes a byte-array to the stream; supported wire-types: String
Writes a byte-array to the stream; supported wire-types: String
Writes a byte-array to the stream; supported wire-types: String
Writes a binary chunk to the stream; supported wire-types: String
Writes a binary chunk to the stream; supported wire-types: String
Writes a binary chunk to the stream; supported wire-types: String
Writes an object to the input writer as a root value; if the
object is determined to be a scalar, it is written as though it were
part of a message with field-number 1
Abandon any pending unflushed data
Used for packed encoding; writes the length prefix using fixed sizes rather than using
buffering. Only valid for fixed-32 and fixed-64 encoding.
Indicates the start of a nested record.
The instance to write.
A token representing the state of the stream; this token is given to EndSubItem.
Releases any resources associated with this instance
Flushes data to the underlying stream, and releases any resources. The underlying stream is *not* disposed
by this operation.
Indicates the end of a nested record.
The token obtained from StartubItem.
Copies any extension data stored for the instance to the underlying stream
Copies any extension data stored for the instance to the underlying stream
Used for packed encoding; indicates that the next field should be skipped rather than
a field header written. Note that the field number must match, else an exception is thrown
when the attempt is made to write the (incorrect) field. The wire-type is taken from the
subsequent call to WriteFieldHeader. Only primitive types can be packed.
Used for packed encoding; explicitly reset the packed field marker; this is not required
if using StartSubItem/EndSubItem
Throws an exception indicating that the given enum cannot be mapped to a serialized value.
Creates a new writer against a stream
The destination stream
The model to use for serialization; this can be null, but this will impair the ability to serialize sub-objects
Additional context about this serialization operation
Writes a field-header, indicating the format of the next data we plan to write.
Writes a byte-array to the stream; supported wire-types: String
Writes a byte-array to the stream; supported wire-types: String
Indicates the start of a nested record.
The instance to write.
The destination.
A token representing the state of the stream; this token is given to EndSubItem.
Indicates the end of a nested record.
The token obtained from StartubItem.
The destination.
Creates a new writer against a stream
The model to use for serialization; this can be null, but this will impair the ability to serialize sub-objects
Additional context about this serialization operation
Whether this initialization should impact usage counters (to check for double-usage)
Addition information about this serialization operation.
Addition information about this serialization operation.
Writes a sub-item to the input writer
Writes a sub-item to the input writer
Abandon any pending unflushed data
Flushes data to the underlying stream, and releases any resources. The underlying stream is *not* disposed
by this operation.
Get the TypeModel associated with this writer
The encoding used by the writer
Writes a string to the stream; supported wire-types: String
Writes any buffered data (if possible) to the underlying stream.
Wwriter state
It is not always possible to fully flush, since some sequences
may require values to be back-filled into the byte-stream.
Writes an unsigned 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes a signed 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes a signed 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes an unsigned 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Writes a signed 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes a signed 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Writes a double-precision number to the stream; supported wire-types: Fixed32, Fixed64
Writes a single-precision number to the stream; supported wire-types: Fixed32, Fixed64
Throws an exception indicating that the given enum cannot be mapped to a serialized value.
Writes a boolean to the stream; supported wire-types: Variant, Fixed32, Fixed64
Copies any extension data stored for the instance to the underlying stream
Used for packed encoding; indicates that the next field should be skipped rather than
a field header written. Note that the field number must match, else an exception is thrown
when the attempt is made to write the (incorrect) field. The wire-type is taken from the
subsequent call to WriteFieldHeader. Only primitive types can be packed.
Used for packed encoding; explicitly reset the packed field marker; this is not required
if using StartSubItem/EndSubItem
Used for packed encoding; writes the length prefix using fixed sizes rather than using
buffering. Only valid for fixed-32 and fixed-64 encoding.
Buffer size to use when writing; if non-positive, an internal default is used.
Not all writer implementations make use of this API
Writes a Type to the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String
Gets the default state associated with this writer
Creates a new writer against a stream
The destination stream
The model to use for serialization; this can be null, but this will impair the ability to serialize sub-objects
Additional context about this serialization operation
Additional information about a serialization operation
Gets or sets a user-defined object containing additional information about this serialization/deserialization operation.
A default SerializationContext, with minimal information.
Gets or sets the source or destination of the transmitted data.
Convert a SerializationContext to a StreamingContext
Convert a StreamingContext to a SerializationContext
Create a StreamingContext from a serialization context
Creates a frozen SerializationContext from a serialization context
Provides utility methods for creating enum serializers
Create an enum serializer for the provided type, which much be a matching enum
Create an enum serializer for the provided type, which much be a matching enum
Create an enum serializer for the provided type, which much be a matching enum
Create an enum serializer for the provided type, which much be a matching enum
Create an enum serializer for the provided type, which much be a matching enum
Create an enum serializer for the provided type, which much be a matching enum
Create an enum serializer for the provided type, which much be a matching enum
Create an enum serializer for the provided type, which much be a matching enum
Base type for enum serializers
Deserialize an enum
Serialize an enum
Provides an abstract way of referring to simple range-based
data types as Memory.
Provides a non-null value from the provided storage.
For many value-types, this will simply return the input value. For
reference-types, the input should be null-coalesced against an
empty value such as Array.Empty().
Get the length (in terms of element count) of the provided storage.
Access a Memory that is the underlying
data held by this storage.
Resizes (typically: allocates and copies) the provided storage by
the requested additional capacity, returning a memory to *just
the additional portion*). The implementor is responsible for
ensuring that the old values are copied if necessary.
The implementor may choose to recycle the old storage, if
appropriate.
Provides a memory converter implementation for many common storage kinds.
Provides the singleton instance for element type .
Indicates capabilities and behaviors of a serializer
Base-128 variable-length encoding
Fixed-length 8-byte encoding
Length-variant-prefixed encoding
Indicates the start of a group
Fixed-length 4-byte encoding
10
Denotes a varint that should be interpreted using
zig-zag semantics (so -ve numbers aren't a significant overhead)
Indicates that the wire-type has been explicitly specified
Indicates that this data should be treated like a list/array
Scalars are simple types such as integers, not messages; when written as
a root message, a field-one wrapper is added
Indicates a type that is a message
Indicates a type that is both "message" and "scalar"; *at the root only* it will be a message wrapped like a scalar; otherwise, it is
treated as a message; see: DateTime/TimeSpan
Explicitly disables packed encoding; normally, packed encoding is
used by default when appropriate
List-like values should clear any existing contents before adding new
Maps should use dictionary Add rather than overwrite; this means that duplicate keys will cause failure
Disable recursion checking
Abstract API capable of serializing/deserializing messages or values
Deserialize an instance from the supplied writer
Serialize an instance to the supplied writer
Indicates the features (including the default wire-type) for this type/serializer
Provides indirect access to a serializer for a given type
Gets the actual serializer for the type
Abstract API capable of measuring values without writing them
Measure the given value, reporting the required length for the payload (not including the field-header)
Abstract API capable of serializing/deserializing a sequence of messages or values
Serialize a sequence of values to the supplied writer
Deserializes a sequence of values from the supplied reader
A serializer capable of representing complex objects that may warrant length caching
The effective that this serializer represents; in the case of
an object hierarchy, this is the base-type.
Abstract API capable of serializing/deserializing objects as part of a type hierarchy
Serialize an instance to the supplied writer
Deserialize an instance from the supplied writer
Represents the state of an inheritance deserialization operation
Create a new value, using the provided concrete type if a new instance is required
Gets or sets the current instance represented
Ensures that the instance has a value
Indicates whether an instance currently exists
Parse the input as a sub-type of the instance
Specifies a serialization callback to be used when the item is constructed; if the item already exists, the callback is executed immediately
Abstract API capable of serializing/deserializing complex objects with inheritance
Create a new instance of the type
Provides utility methods for creating serializers for repeated data
Create a map serializer that operates on concurrent dictionaries
Create a map serializer that operates on dictionaries
Create a map serializer that operates on dictionaries
Create a map serializer that operates on immutable dictionaries
Create a map serializer that operates on immutable dictionaries
Create a map serializer that operates on immutable dictionaries
Base class for dictionary-like collection serializers
Deserializes a sequence of values from the supplied reader
Ensure that the collection is not nil, if required
Remove any existing contents from the collection
Add new contents to the collection
Update the new contents intoto the collection, overwriting existing values
Deserializes a sequence of values from the supplied reader
ExternalMapSerializer provides a base class for concrete types to inherit from, but only provide the methods for collection management
It does not require changes to internal protobuf-net state handling
the collection type being provided (e.g. Map for F#)
key to the collection
type of the value held within the collection
Provides utility methods for creating serializers for repeated data
Create a serializer that operates on immutable sets
Create a serializer that operates on immutable sets
Create a serializer that operates on immutable sets
Create a serializer that operates on immutable sets
Create a serializer that indicates that a scenario is not supported
Create a serializer that indicates that a scenario is not supported
Create a serializer that operates on lists
Create a serializer that operates on lists
Create a serializer that operates on most common collections
Create a serializer that operates on most common collections
Create a serializer that operates on lists
Create a serializer that operates on lists
Create a serializer that operates on lists
Reverses a range of values
Create a serializer that operates on immutable arrays
Create a serializer that operates on immutable lists
Create a serializer that operates on immutable lists
Create a serializer that operates on immutable queues
Create a serializer that operates on immutable queues
Create a serializer that operates on immutable stacks
Create a serializer that operates on immutable stacks
Create a serializer that operates on immutable sets
Create a serializer that operates on immutable sets
Create a serializer that operates on immutable sets
Base class for simple collection serializers
Serialize a sequence of values to the supplied writer
If possible to do so *cheaply*, return the count of the items in the collection
TryGetCountDefault can be used as a reasonable fallback
Applies a range of common strategies for cheaply counting collections
This involves multiple tests and exception handling; if your collection is known to be reliable, you should prefer an exposed .Count or similar
Deserializes a sequence of values from the supplied reader
Ensure that the collection is not nil, if required
Remove any existing contents from the collection
Add new contents to the collection
ExternalSerializer provides a base class for concrete types to inherit from, but only provide the methods for collection management
It does not require changes to internal protobuf-net state handling
the collection type being provided (e.g. Map for F#)
type of the value held within the collection
Provides access to cached serializers
Gets a cached serializer instance for a type, in the context of a given provider
Not yet implemented
Used to hold particulars relating to nested objects. This is opaque to the caller - simply
give back the token you are given at the end of an object.
See object.ToString()
See object.GetHashCode()
See object.Equals()
Provides etension methods to access extended (unknown) fields against an instance
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned (in "value") is the composed value after merging any duplicated content;
if the value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The effective value of the field, or the default value if not found.
The extensible object to obtain the value from.
The type model to use for deserialization.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
The that holds the fields, in terms of the inheritance model; the same tag key can appear against different type levels for the same instance, with different values.
True if data for the field was present, false otherwise.
Queries an extensible object for an additional (unexpected) data-field for the instance.
The value returned is the composed value after merging any duplicated content; if the
value is "repeated" (a list), then use GetValues instead.
The data-type of the field.
The type model to use for deserialization.
The extensible object to obtain the value from.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
The that holds the fields, in terms of the inheritance model; the same tag key can appear against different type levels for the same instance, with different values.
The effective value of the field, or the default value if not found.
Queries an extensible object for an additional (unexpected) data-field for the instance.
Each occurrence of the field is yielded separately, making this usage suitable for "repeated"
(list) fields.
The extended data is processed lazily as the enumerator is iterated.
The data-type of the field.
The extensible object to obtain the value from.
The type model to use for deserialization.
The field identifier; the tag should not be defined as a known data-field for the instance.
The data-format to use when decoding the value.
The that holds the fields, in terms of the inheritance model; the same tag key can appear against different type levels for the same instance, with different values.
An enumerator that yields each occurrence of the field.
Appends the value as an additional (unexpected) data-field for the instance.
Note that for non-repeated sub-objects, this equates to a merge operation;
for repeated sub-objects this adds a new instance to the set; for simple
values the new value supercedes the old value.
Note that appending a value does not remove the old value from
the stream; avoid repeatedly appending values for the same field.
The data-type of the field.
The data-format to use when encoding the value.
The model to use for serialization.
The extensible object to append the value to.
The field identifier; the tag should not be defined as a known data-field for the instance.
The value to append.
The that holds the fields, in terms of the inheritance model; the same tag key can appear against different type levels for the same instance, with different values.
Maps a field-number to a type
A Duration represents a signed, fixed-length span of time represented
as a count of seconds and fractions of seconds at nanosecond
resolution. It is independent of any calendar and concepts like "day"
or "month". It is related to Timestamp in that the difference between
two Timestamp values is a Duration and it can be added or subtracted
from a Timestamp.
Signed seconds of the span of time.
Signed fractions of a second at nanosecond resolution of the span of time.
Creates a new Duration with the supplied values
Converts a TimeSpan to a Duration
Converts a Duration to a TimeSpan
Converts a Duration to a TimeSpan
Converts a TimeSpan to a Duration
Applies .proto rules to ensure that this value is in the expected ranges
A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs
A Timestamp represents a point in time independent of any time zone or local
calendar, encoded as a count of seconds and fractions of seconds at
nanosecond resolution. The count is relative to an epoch at UTC midnight on
January 1, 1970, in the proleptic Gregorian calendar which extends the
Gregorian calendar backwards to year one.
Represents seconds of UTC time since Unix epoch
Non-negative fractions of a second at nanosecond resolution.
Creates a new Duration with the supplied values
Converts a DateTime to a Timestamp
Applies .proto rules to ensure that this value is in the expected ranges
Converts a Timestamp to a DateTime
Converts a Timestamp to a DateTime
Converts a DateTime to a Timestamp
The default value for dates that are following google.protobuf.Timestamp semantics
Indicates the encoding used to represent an individual value in a protobuf stream
Represents an error condition
Base-128 variable-length encoding
Base-128 variable-length encoding
Fixed-length 8-byte encoding
Length-variant-prefixed encoding
Indicates the start of a group
Indicates the end of a group
Fixed-length 4-byte encoding
10
This is not a formal wire-type in the "protocol buffers" spec, but
denotes a varint that should be interpreted using
zig-zag semantics (so -ve numbers aren't a significant overhead)
This is not a formal wire-type in the "protocol buffers" spec, but
denotes a varint that should be interpreted using
zig-zag semantics (so -ve numbers aren't a significant overhead)
Indicates that certain members on a specified are accessed dynamically,
for example through .
This allows tools to understand which members are being accessed during the execution
of a program.
This attribute is valid on members whose type is or .
When this attribute is applied to a location of type , the assumption is
that the string represents a fully qualified type name.
If the attribute is applied to a method it's treated as a special case and it implies
the attribute should be applied to the "this" parameter of the method. As such the attribute
should only be used on instance methods of types assignable to System.Type (or string, but no methods
will use it there).
Initializes a new instance of the class
with the specified member types.
The types of members dynamically accessed.
Gets the which specifies the type
of members dynamically accessed.
Specifies the types of members that are dynamically accessed.
This enumeration has a attribute that allows a
bitwise combination of its member values.
Specifies no members.
Specifies the default, parameterless public constructor.
Specifies all public constructors.
Specifies all non-public constructors.
Specifies all public methods.
Specifies all non-public methods.
Specifies all public fields.
Specifies all non-public fields.
Specifies all public nested types.
Specifies all non-public nested types.
Specifies all public properties.
Specifies all non-public properties.
Specifies all public events.
Specifies all non-public events.
Specifies all members.