Space Engineers
|
Represents an output stream for writing protobuf data. More...
Public Member Functions | |
ProtoWriter (Stream dest, TypeModel model, SerializationContext context) | |
Creates a new writer against a stream More... | |
void | Close () |
Flushes data to the underlying stream, and releases any resources. The underlying stream is not disposed by this operation. More... | |
void | SetRootObject (object value) |
Specifies a known root object to use during reference-tracked serialization More... | |
Static Public Member Functions | |
static void | WriteObject (object value, int key, ProtoWriter writer) |
Write an encapsulated sub-object, using the supplied unique key (reprasenting a type). More... | |
static void | WriteRecursionSafeObject (object value, int key, ProtoWriter writer) |
Write an encapsulated sub-object, using the supplied unique key (reprasenting a type) - but the caller is asserting that this relationship is non-recursive; no recursion check will be performed. More... | |
static void | WriteFieldHeader (int fieldNumber, WireType wireType, ProtoWriter writer) |
Writes a field-header, indicating the format of the next data we plan to write. More... | |
static void | WriteBytes (byte[] data, ProtoWriter writer) |
Writes a byte-array to the stream; supported wire-types: String More... | |
static void | WriteBytes (byte[] data, int offset, int length, ProtoWriter writer) |
Writes a byte-array to the stream; supported wire-types: String More... | |
static SubItemToken | StartSubItem (object instance, ProtoWriter writer) |
Indicates the start of a nested record. More... | |
static void | EndSubItem (SubItemToken token, ProtoWriter writer) |
Indicates the end of a nested record. More... | |
static void | WriteString (string value, ProtoWriter writer) |
Writes a string to the stream; supported wire-types: String More... | |
static void | WriteUInt64 (ulong value, ProtoWriter writer) |
Writes an unsigned 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 More... | |
static void | WriteInt64 (long value, ProtoWriter writer) |
Writes a signed 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant More... | |
static void | WriteUInt32 (uint value, ProtoWriter writer) |
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 More... | |
static void | WriteInt16 (short value, ProtoWriter writer) |
Writes a signed 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant More... | |
static void | WriteUInt16 (ushort value, ProtoWriter writer) |
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 More... | |
static void | WriteByte (byte value, ProtoWriter writer) |
Writes an unsigned 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 More... | |
static void | WriteSByte (sbyte value, ProtoWriter writer) |
Writes a signed 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant More... | |
static void | WriteInt32 (int value, ProtoWriter writer) |
Writes a signed 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant More... | |
static unsafe void | WriteDouble (double value, ProtoWriter writer) |
Writes a double-precision number to the stream; supported wire-types: Fixed32, Fixed64 More... | |
static unsafe void | WriteSingle (float value, ProtoWriter writer) |
Writes a single-precision number to the stream; supported wire-types: Fixed32, Fixed64 More... | |
static void | ThrowEnumException (ProtoWriter writer, object enumValue) |
Throws an exception indicating that the given enum cannot be mapped to a serialized value. More... | |
static void | WriteBoolean (bool value, ProtoWriter writer) |
Writes a boolean to the stream; supported wire-types: Variant, Fixed32, Fixed64 More... | |
static void | AppendExtensionData (IExtensible instance, ProtoWriter writer) |
Copies any extension data stored for the instance to the underlying stream More... | |
static void | SetPackedField (int fieldNumber, ProtoWriter writer) |
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. More... | |
static void | WriteType (System.Type value, ProtoWriter writer) |
Writes a Type to the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String More... | |
Properties | |
SerializationContext | Context [get] |
Addition information about this serialization operation. More... | |
TypeModel | Model [get] |
Get the TypeModel associated with this writer More... | |
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
Definition at line 23 of file ProtoWriter.cs.
|
inline |
Creates a new writer against a stream
dest | The destination stream |
model | The model to use for serialization; this can be null, but this will impair the ability to serialize sub-objects |
context | Additional context about this serialization operation |
Definition at line 445 of file ProtoWriter.cs.
|
inlinestatic |
Copies any extension data stored for the instance to the underlying stream
Definition at line 878 of file ProtoWriter.cs.
|
inline |
Flushes data to the underlying stream, and releases any resources. The underlying stream is not disposed by this operation.
Definition at line 502 of file ProtoWriter.cs.
|
inlinestatic |
Indicates the end of a nested record.
token | The token obtained from StartubItem. |
writer | The destination. |
Definition at line 359 of file ProtoWriter.cs.
|
inlinestatic |
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.
Definition at line 907 of file ProtoWriter.cs.
|
inline |
Specifies a known root object to use during reference-tracked serialization
Definition at line 920 of file ProtoWriter.cs.
|
inlinestatic |
Indicates the start of a nested record.
instance | The instance to write. |
writer | The destination. |
Definition at line 290 of file ProtoWriter.cs.
|
inlinestatic |
Throws an exception indicating that the given enum cannot be mapped to a serialized value.
Definition at line 856 of file ProtoWriter.cs.
|
inlinestatic |
Writes a boolean to the stream; supported wire-types: Variant, Fixed32, Fixed64
Definition at line 870 of file ProtoWriter.cs.
|
inlinestatic |
Writes an unsigned 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Definition at line 720 of file ProtoWriter.cs.
|
inlinestatic |
Writes a byte-array to the stream; supported wire-types: String
Definition at line 191 of file ProtoWriter.cs.
|
inlinestatic |
Writes a byte-array to the stream; supported wire-types: String
Definition at line 198 of file ProtoWriter.cs.
|
inlinestatic |
Writes a double-precision number to the stream; supported wire-types: Fixed32, Fixed64
Definition at line 804 of file ProtoWriter.cs.
|
inlinestatic |
Writes a field-header, indicating the format of the next data we plan to write.
Definition at line 136 of file ProtoWriter.cs.
|
inlinestatic |
Writes a signed 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Definition at line 706 of file ProtoWriter.cs.
|
inlinestatic |
Writes a signed 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Definition at line 742 of file ProtoWriter.cs.
|
inlinestatic |
Writes a signed 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Definition at line 624 of file ProtoWriter.cs.
|
inlinestatic |
Write an encapsulated sub-object, using the supplied unique key (reprasenting a type).
value | The object to write. |
key | The key that uniquely identifies the type within the model. |
writer | The destination. |
Definition at line 33 of file ProtoWriter.cs.
|
inlinestatic |
Write an encapsulated sub-object, using the supplied unique key (reprasenting a type) - but the caller is asserting that this relationship is non-recursive; no recursion check will be performed.
value | The object to write. |
key | The key that uniquely identifies the type within the model. |
writer | The destination. |
Definition at line 67 of file ProtoWriter.cs.
|
inlinestatic |
Writes a signed 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant
Definition at line 727 of file ProtoWriter.cs.
|
inlinestatic |
Writes a single-precision number to the stream; supported wire-types: Fixed32, Fixed64
Definition at line 835 of file ProtoWriter.cs.
|
inlinestatic |
Writes a string to the stream; supported wire-types: String
Definition at line 573 of file ProtoWriter.cs.
|
inlinestatic |
Writes a Type to the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String
Definition at line 928 of file ProtoWriter.cs.
|
inlinestatic |
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Definition at line 713 of file ProtoWriter.cs.
|
inlinestatic |
Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Definition at line 683 of file ProtoWriter.cs.
|
inlinestatic |
Writes an unsigned 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64
Definition at line 602 of file ProtoWriter.cs.
|
get |
Addition information about this serialization operation.
Definition at line 464 of file ProtoWriter.cs.
|
get |
Get the TypeModel associated with this writer
Definition at line 516 of file ProtoWriter.cs.