SerializationStream Class
Namespace: Stride.Core.SerializationAssembly: Stride.Core.dll
Base class for implementation of SerializationStream.
public abstract class SerializationStream
Name | Description | |
---|---|---|
Constructors | ||
SerializationStream() | Initializes a new instance of the SerializationStream class. |
|
Fields | ||
bufferTLS | ||
BufferTLSSize | ||
Properties | ||
Context | The serializer context. |
|
NativeStream | The underlying native stream. |
|
Methods | ||
Flush() | Flushes all recent writes (for better batching). Please note that if only Serialize has been used (no PopTag()), Flush() should be called manually. |
|
Serialize(ref Boolean) | Serializes the specified boolean value. |
|
Serialize(ref Byte) | Serializes the specified byte value. |
|
Serialize(Byte[], Int32, Int32) | Serializes the specified byte array. |
|
Serialize(ref Char) | Serializes the specified char value. |
|
Serialize(ref Double) | Serializes the specified double value. |
|
Serialize(ref Int16) | Serializes the specified short value. |
|
Serialize(ref Int32) | Serializes the specified integer value. |
|
Serialize(ref Int64) | Serializes the specified long value. |
|
Serialize(IntPtr, Int32) | Serializes the specified memory area. |
|
Serialize(ref SByte) | Serializes the specified signed byte value. |
|
Serialize(ref Single) | Serializes the specified float value. |
|
Serialize(ref String) | Serializes the specified string value. |
|
Serialize(ref UInt16) | Serializes the specified ushort value. |
|
Serialize(ref UInt32) | Serializes the specified unsigned integer value. |
|
Serialize(ref UInt64) | Serializes the specified unsigned long value. |
Constructors
SerializationStream()
Initializes a new instance of the SerializationStream class.
protected SerializationStream()
Fields
bufferTLS
[ThreadStatic]
protected static byte[] bufferTLS
Field Value
Type | Description |
---|---|
System.Byte[] |
BufferTLSSize
protected const int BufferTLSSize = 1024
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
Context
The serializer context.
public SerializerContext Context { get; set; }
Property Value
Type | Description |
---|---|
SerializerContext |
NativeStream
The underlying native stream.
public NativeStream NativeStream { get; protected set; }
Property Value
Type | Description |
---|---|
NativeStream |
Methods
Flush()
Flushes all recent writes (for better batching). Please note that if only Serialize has been used (no PopTag()), Flush() should be called manually.
public abstract void Flush()
Serialize(ref Boolean)
Serializes the specified boolean value.
public abstract void Serialize(ref bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value to serialize |
Serialize(ref Byte)
Serializes the specified byte value.
public abstract void Serialize(ref byte value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | The value to serialize |
Serialize(Byte[], Int32, Int32)
Serializes the specified byte array.
public abstract void Serialize(byte[] values, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | values | The buffer to serialize. |
System.Int32 | offset | The starting offset in the buffer to begin serializing. |
System.Int32 | count | The size, in bytes, to serialize. |
Serialize(ref Char)
Serializes the specified char value.
public abstract void Serialize(ref char value)
Parameters
Type | Name | Description |
---|---|---|
System.Char | value | The value to serialize |
Serialize(ref Double)
Serializes the specified double value.
public abstract void Serialize(ref double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to serialize |
Serialize(ref Int16)
Serializes the specified short value.
public abstract void Serialize(ref short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | value | The value to serialize |
Serialize(ref Int32)
Serializes the specified integer value.
public abstract void Serialize(ref int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to serialize |
Serialize(ref Int64)
Serializes the specified long value.
public abstract void Serialize(ref long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The value to serialize |
Serialize(IntPtr, Int32)
Serializes the specified memory area.
public abstract void Serialize(IntPtr memory, int count)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | memory | The memory area to serialize. |
System.Int32 | count | The size, in bytes, to serialize. |
Serialize(ref SByte)
Serializes the specified signed byte value.
public abstract void Serialize(ref sbyte value)
Parameters
Type | Name | Description |
---|---|---|
System.SByte | value | The value to serialize |
Serialize(ref Single)
Serializes the specified float value.
public abstract void Serialize(ref float value)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | The value to serialize |
Serialize(ref String)
Serializes the specified string value.
public abstract void Serialize(ref string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to serialize |
Serialize(ref UInt16)
Serializes the specified ushort value.
public abstract void Serialize(ref ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | value | The value to serialize |
Serialize(ref UInt32)
Serializes the specified unsigned integer value.
public abstract void Serialize(ref uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value to serialize |
Serialize(ref UInt64)
Serializes the specified unsigned long value.
public abstract void Serialize(ref ulong value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | value | The value to serialize |