Struct DataStreamWriter
Syntax
public struct DataStreamWriter
Constructors
DataStreamWriter(NativeArray<Byte>)
Declaration
public DataStreamWriter(NativeArray<byte> data)
Parameters
Type |
Name |
Description |
NativeArray<Byte> |
data |
|
DataStreamWriter(Int32, Allocator)
Declaration
public DataStreamWriter(int length, Allocator allocator)
Parameters
Type |
Name |
Description |
Int32 |
length |
|
Allocator |
allocator |
|
Properties
Capacity
The total size of the data buffer, see Length for
the size of space used in the buffer.
Declaration
public int Capacity { get; }
Property Value
HasFailedWrites
Declaration
public bool HasFailedWrites { get; }
Property Value
IsCreated
True if there is a valid data buffer present. This would be false
if the writer was created with no arguments.
Declaration
public bool IsCreated { get; }
Property Value
Length
The size of the buffer used. See Capacity for the total size.
Declaration
public int Length { get; }
Property Value
LengthInBits
The size of the buffer used in bits. See Length for the length in bytes.
Declaration
public int LengthInBits { get; }
Property Value
Methods
AsNativeArray()
Declaration
public NativeArray<byte> AsNativeArray()
Returns
Type |
Description |
NativeArray<Byte> |
|
Clear()
Moves the write position to the start of the data buffer used.
Declaration
Flush()
Declaration
WriteByte(Byte)
Declaration
public bool WriteByte(byte value)
Parameters
Type |
Name |
Description |
Byte |
value |
|
Returns
WriteBytes(NativeArray<Byte>)
Copy NativeArray of bytes into the writers data buffer.
Declaration
public bool WriteBytes(NativeArray<byte> value)
Parameters
Type |
Name |
Description |
NativeArray<Byte> |
value |
Source byte array
|
Returns
WriteBytes(Byte*, Int32)
Declaration
public bool WriteBytes(byte *data, int bytes)
Parameters
Returns
WriteFloat(Single)
Declaration
public bool WriteFloat(float value)
Parameters
Type |
Name |
Description |
Single |
value |
|
Returns
WriteInt(Int32)
Declaration
public bool WriteInt(int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
Returns
WriteIntNetworkByteOrder(Int32)
Declaration
public bool WriteIntNetworkByteOrder(int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
Returns
WritePackedFloat(Single, NetworkCompressionModel)
Declaration
public bool WritePackedFloat(float value, NetworkCompressionModel model)
Parameters
Returns
WritePackedFloatDelta(Single, Single, NetworkCompressionModel)
Declaration
public bool WritePackedFloatDelta(float value, float baseline, NetworkCompressionModel model)
Parameters
Returns
WritePackedInt(Int32, NetworkCompressionModel)
Declaration
public bool WritePackedInt(int value, NetworkCompressionModel model)
Parameters
Returns
WritePackedIntDelta(Int32, Int32, NetworkCompressionModel)
Declaration
public bool WritePackedIntDelta(int value, int baseline, NetworkCompressionModel model)
Parameters
Returns
WritePackedStringDelta(NativeString64, NativeString64, NetworkCompressionModel)
Declaration
public bool WritePackedStringDelta(NativeString64 str, NativeString64 baseline, NetworkCompressionModel model)
Parameters
Returns
WritePackedUInt(UInt32, NetworkCompressionModel)
Declaration
public bool WritePackedUInt(uint value, NetworkCompressionModel model)
Parameters
Returns
WritePackedUIntDelta(UInt32, UInt32, NetworkCompressionModel)
Declaration
public bool WritePackedUIntDelta(uint value, uint baseline, NetworkCompressionModel model)
Parameters
Returns
WriteShort(Int16)
Declaration
public bool WriteShort(short value)
Parameters
Type |
Name |
Description |
Int16 |
value |
|
Returns
WriteShortNetworkByteOrder(Int16)
Declaration
public bool WriteShortNetworkByteOrder(short value)
Parameters
Type |
Name |
Description |
Int16 |
value |
|
Returns
WriteString(NativeString64)
Declaration
public bool WriteString(NativeString64 str)
Parameters
Type |
Name |
Description |
NativeString64 |
str |
|
Returns
WriteUInt(UInt32)
Declaration
public bool WriteUInt(uint value)
Parameters
Type |
Name |
Description |
UInt32 |
value |
|
Returns
WriteUIntNetworkByteOrder(UInt32)
Declaration
public bool WriteUIntNetworkByteOrder(uint value)
Parameters
Type |
Name |
Description |
UInt32 |
value |
|
Returns
WriteULong(UInt64)
Declaration
public bool WriteULong(ulong value)
Parameters
Type |
Name |
Description |
UInt64 |
value |
|
Returns
WriteUShort(UInt16)
Declaration
public bool WriteUShort(ushort value)
Parameters
Type |
Name |
Description |
UInt16 |
value |
|
Returns
WriteUShortNetworkByteOrder(UInt16)
Declaration
public bool WriteUShortNetworkByteOrder(ushort value)
Parameters
Type |
Name |
Description |
UInt16 |
value |
|
Returns