Skip to main content

Unity.Networking.Transport.DataStreamWriter

Inherited Members#

ValueType.Equals(Object)

ValueType.GetHashCode()

ValueType.ToString()

Object.Equals(Object, Object)

Object.GetType()

Object.ReferenceEquals(Object, Object)

Namespace: System.Dynamic.ExpandoObject#
Assembly: transport.dll#
Syntax#
public struct DataStreamWriter

DataStreamWriter(NativeArray\<Byte>)#

Initializes a new instance of the DataStreamWriter struct with a NativeArray{byte}

Declaration#

public DataStreamWriter(NativeArray<byte> data)

Parameters#

TypeNameDescription
NativeArray\<System.Byte>dataThe buffer we want to attach to our DataStreamWriter.

DataStreamWriter(Byte*, Int32)#

Initializes a new instance of the DataStreamWriter struct with a memory we don't own

Declaration#

public DataStreamWriter(byte *data, int length)

Parameters#

TypeNameDescription
System.Byte*dataPointer to the data
System.Int32lengthLength of the data

DataStreamWriter(Int32, Allocator)#

Initializes a new instance of the DataStreamWriter struct.

Declaration#

public DataStreamWriter(int length, Allocator allocator)

Parameters#

TypeNameDescription
System.Int32lengthThe length of the buffer.
AllocatorallocatorThe used to allocate the memory.

#

Capacity#

The total size of the data buffer, see Length for the size of space used in the buffer.

Declaration#

public readonly int Capacity { get; }

Property Value#

TypeDescription
System.Int32

HasFailedWrites#

Declaration#

public readonly bool HasFailedWrites { get; }

Property Value#

TypeDescription
System.Boolean

IsCreated#

True if there is a valid data buffer present. This would be false if the writer was created with no arguments.

Declaration#

public readonly bool IsCreated { get; }

Property Value#

TypeDescription
System.Boolean

IsLittleEndian#

Declaration#

public static readonly bool IsLittleEndian { get; }

Property Value#

TypeDescription
System.Boolean

Length#

The size of the buffer used. See Capacity for the total size.

Declaration#

public readonly int Length { get; }

Property Value#

TypeDescription
System.Int32

LengthInBits#

The size of the buffer used in bits. See Length for the length in bytes.

Declaration#

public readonly int LengthInBits { get; }

Property Value#

TypeDescription
System.Int32

#

AsNativeArray()#

Declaration#

public NativeArray<byte> AsNativeArray()

Returns#

TypeDescription
NativeArray\<System.Byte>

Clear()#

Moves the write position to the start of the data buffer used.

Declaration#

public void Clear()

Flush()#

Declaration#

public void Flush()

WriteByte(Byte)#

Declaration#

public bool WriteByte(byte value)

Parameters#

TypeNameDescription
System.Bytevalue

Returns#

TypeDescription
System.Boolean

WriteBytes(NativeArray\<Byte>)#

Copy NativeArray of bytes into the writers data buffer.

Declaration#

public bool WriteBytes(NativeArray<byte> value)

Parameters#

TypeNameDescription
NativeArray\<System.Byte>valueSource byte array

Returns#

TypeDescription
System.Boolean

WriteBytes(Byte*, Int32)#

Declaration#

public bool WriteBytes(byte *data, int bytes)

Parameters#

TypeNameDescription
System.Byte*data
System.Int32bytes

Returns#

TypeDescription
System.Boolean

WriteFixedString128(FixedString128Bytes)#

Declaration#

public bool WriteFixedString128(FixedString128Bytes str)

Parameters#

TypeNameDescription
FixedString128Bytesstr

Returns#

TypeDescription
System.Boolean

WriteFixedString32(FixedString32Bytes)#

Declaration#

public bool WriteFixedString32(FixedString32Bytes str)

Parameters#

TypeNameDescription
FixedString32Bytesstr

Returns#

TypeDescription
System.Boolean

WriteFixedString4096(FixedString4096Bytes)#

Declaration#

public bool WriteFixedString4096(FixedString4096Bytes str)

Parameters#

TypeNameDescription
FixedString4096Bytesstr

Returns#

TypeDescription
System.Boolean

WriteFixedString512(FixedString512Bytes)#

Declaration#

public bool WriteFixedString512(FixedString512Bytes str)

Parameters#

TypeNameDescription
FixedString512Bytesstr

Returns#

TypeDescription
System.Boolean

WriteFixedString64(FixedString64Bytes)#

Declaration#

public bool WriteFixedString64(FixedString64Bytes str)

Parameters#

TypeNameDescription
FixedString64Bytesstr

Returns#

TypeDescription
System.Boolean

WriteFloat(Single)#

Declaration#

public bool WriteFloat(float value)

Parameters#

TypeNameDescription
System.Singlevalue

Returns#

TypeDescription
System.Boolean

WriteInt(Int32)#

Declaration#

public bool WriteInt(int value)

Parameters#

TypeNameDescription
System.Int32value

Returns#

TypeDescription
System.Boolean

WriteIntNetworkByteOrder(Int32)#

Declaration#

public bool WriteIntNetworkByteOrder(int value)

Parameters#

TypeNameDescription
System.Int32value

Returns#

TypeDescription
System.Boolean

WriteLong(Int64)#

Declaration#

public bool WriteLong(long value)

Parameters#

TypeNameDescription
System.Int64value

Returns#

TypeDescription
System.Boolean

WritePackedFixedString128Delta(FixedString128Bytes, FixedString128Bytes, NetworkCompressionModel)#

Declaration#

public bool WritePackedFixedString128Delta(FixedString128Bytes str, FixedString128Bytes baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
FixedString128Bytesstr
FixedString128Bytesbaseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedFixedString32Delta(FixedString32Bytes, FixedString32Bytes, NetworkCompressionModel)#

Declaration#

public bool WritePackedFixedString32Delta(FixedString32Bytes str, FixedString32Bytes baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
FixedString32Bytesstr
FixedString32Bytesbaseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedFixedString4096Delta(FixedString4096Bytes, FixedString4096Bytes, NetworkCompressionModel)#

Declaration#

public bool WritePackedFixedString4096Delta(FixedString4096Bytes str, FixedString4096Bytes baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
FixedString4096Bytesstr
FixedString4096Bytesbaseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedFixedString512Delta(FixedString512Bytes, FixedString512Bytes, NetworkCompressionModel)#

Declaration#

public bool WritePackedFixedString512Delta(FixedString512Bytes str, FixedString512Bytes baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
FixedString512Bytesstr
FixedString512Bytesbaseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedFixedString64Delta(FixedString64Bytes, FixedString64Bytes, NetworkCompressionModel)#

Declaration#

public bool WritePackedFixedString64Delta(FixedString64Bytes str, FixedString64Bytes baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
FixedString64Bytesstr
FixedString64Bytesbaseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedFloat(Single, NetworkCompressionModel)#

Declaration#

public bool WritePackedFloat(float value, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.Singlevalue
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedFloatDelta(Single, Single, NetworkCompressionModel)#

Declaration#

public bool WritePackedFloatDelta(float value, float baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.Singlevalue
System.Singlebaseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedInt(Int32, NetworkCompressionModel)#

Declaration#

public bool WritePackedInt(int value, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.Int32value
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedIntDelta(Int32, Int32, NetworkCompressionModel)#

Declaration#

public bool WritePackedIntDelta(int value, int baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.Int32value
System.Int32baseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedLong(Int64, NetworkCompressionModel)#

Declaration#

public bool WritePackedLong(long value, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.Int64value
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedLongDelta(Int64, Int64, NetworkCompressionModel)#

Declaration#

public bool WritePackedLongDelta(long value, long baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.Int64value
System.Int64baseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedUInt(UInt32, NetworkCompressionModel)#

Declaration#

public bool WritePackedUInt(uint value, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.UInt32value
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedUIntDelta(UInt32, UInt32, NetworkCompressionModel)#

Declaration#

public bool WritePackedUIntDelta(uint value, uint baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.UInt32value
System.UInt32baseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedULong(UInt64, NetworkCompressionModel)#

Declaration#

public bool WritePackedULong(ulong value, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.UInt64value
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WritePackedULongDelta(UInt64, UInt64, NetworkCompressionModel)#

Declaration#

public bool WritePackedULongDelta(ulong value, ulong baseline, NetworkCompressionModel model)

Parameters#

TypeNameDescription
System.UInt64value
System.UInt64baseline
NetworkCompressionModelmodel

Returns#

TypeDescription
System.Boolean

WriteRawBits(UInt32, Int32)#

Declaration#

public bool WriteRawBits(uint value, int numbits)

Parameters#

TypeNameDescription
System.UInt32value
System.Int32numbits

Returns#

TypeDescription
System.Boolean

WriteShort(Int16)#

Declaration#

public bool WriteShort(short value)

Parameters#

TypeNameDescription
System.Int16value

Returns#

TypeDescription
System.Boolean

WriteShortNetworkByteOrder(Int16)#

Declaration#

public bool WriteShortNetworkByteOrder(short value)

Parameters#

TypeNameDescription
System.Int16value

Returns#

TypeDescription
System.Boolean

WriteUInt(UInt32)#

Declaration#

public bool WriteUInt(uint value)

Parameters#

TypeNameDescription
System.UInt32value

Returns#

TypeDescription
System.Boolean

WriteUIntNetworkByteOrder(UInt32)#

Declaration#

public bool WriteUIntNetworkByteOrder(uint value)

Parameters#

TypeNameDescription
System.UInt32value

Returns#

TypeDescription
System.Boolean

WriteULong(UInt64)#

Declaration#

public bool WriteULong(ulong value)

Parameters#

TypeNameDescription
System.UInt64value

Returns#

TypeDescription
System.Boolean

WriteUShort(UInt16)#

Declaration#

public bool WriteUShort(ushort value)

Parameters#

TypeNameDescription
System.UInt16value

Returns#

TypeDescription
System.Boolean

WriteUShortNetworkByteOrder(UInt16)#

Declaration#

public bool WriteUShortNetworkByteOrder(ushort value)

Parameters#

TypeNameDescription
System.UInt16value

Returns#

TypeDescription
System.Boolean