Struct DataStreamReader
The DataStreamReader
class is the counterpart of the
DataStreamWriter
class and can be be used to deserialize
data which was prepared with it.
Syntax
public struct DataStreamReader
Constructors
DataStreamReader(NativeArray<Byte>)
Declaration
public DataStreamReader(NativeArray<byte> array)
Parameters
Type |
Name |
Description |
NativeArray<Byte> |
array |
|
Properties
HasFailedReads
Declaration
public bool HasFailedReads { get; }
Property Value
IsCreated
True if the reader has been pointed to a valid buffer space. This
would be false if the reader was created with no arguments.
Declaration
public bool IsCreated { get; }
Property Value
Length
The total size of the buffer space this reader is working with.
Declaration
public int Length { get; }
Property Value
Methods
GetBitsRead()
Declaration
Returns
GetBytesRead()
Declaration
public int GetBytesRead()
Returns
ReadByte()
Declaration
Returns
ReadBytes(NativeArray<Byte>)
Read and copy data into the given NativeArray of bytes, an exception will
be thrown if not enough bytes are available.
Declaration
public void ReadBytes(NativeArray<byte> array)
Parameters
Type |
Name |
Description |
NativeArray<Byte> |
array |
|
ReadBytes(Byte*, Int32)
Read and copy data to the memory location pointed to, an exception will
be thrown if it does not fit.
Declaration
public void ReadBytes(byte *data, int length)
Parameters
Type |
Name |
Description |
Byte* |
data |
|
Int32 |
length |
|
Exceptions
Type |
Condition |
ArgumentOutOfRangeException |
Thrown if the length
will put the reader out of bounds based on the current read pointer
position.
|
ReadFloat()
Declaration
Returns
ReadInt()
Declaration
Returns
ReadIntNetworkByteOrder()
Declaration
public int ReadIntNetworkByteOrder()
Returns
ReadPackedFloat(NetworkCompressionModel)
Declaration
public float ReadPackedFloat(NetworkCompressionModel model)
Parameters
Returns
ReadPackedFloatDelta(Single, NetworkCompressionModel)
Declaration
public float ReadPackedFloatDelta(float baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedInt(NetworkCompressionModel)
Declaration
public int ReadPackedInt(NetworkCompressionModel model)
Parameters
Returns
ReadPackedIntDelta(Int32, NetworkCompressionModel)
Declaration
public int ReadPackedIntDelta(int baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedStringDelta(NativeString64, NetworkCompressionModel)
Declaration
public NativeString64 ReadPackedStringDelta(NativeString64 baseline, NetworkCompressionModel model)
Parameters
Returns
Type |
Description |
NativeString64 |
|
ReadPackedUInt(NetworkCompressionModel)
Declaration
public uint ReadPackedUInt(NetworkCompressionModel model)
Parameters
Returns
ReadPackedUIntDelta(UInt32, NetworkCompressionModel)
Declaration
public uint ReadPackedUIntDelta(uint baseline, NetworkCompressionModel model)
Parameters
Returns
ReadShort()
Declaration
Returns
ReadShortNetworkByteOrder()
Declaration
public short ReadShortNetworkByteOrder()
Returns
ReadString()
Declaration
public NativeString64 ReadString()
Returns
Type |
Description |
NativeString64 |
|
ReadUInt()
Declaration
Returns
ReadUIntNetworkByteOrder()
Declaration
public uint ReadUIntNetworkByteOrder()
Returns
ReadULong()
Declaration
Returns
ReadUShort()
Declaration
public ushort ReadUShort()
Returns
ReadUShortNetworkByteOrder()
Declaration
public ushort ReadUShortNetworkByteOrder()
Returns