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(Byte*, Int32)
Declaration
public DataStreamReader(byte *data, int length)
Parameters
Type |
Name |
Description |
Byte* |
data |
|
Int32 |
length |
|
DataStreamReader(NativeArray<Byte>)
Declaration
public DataStreamReader(NativeArray<byte> array)
Parameters
Properties
HasFailedReads
Declaration
public readonly 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 readonly bool IsCreated { get; }
Property Value
IsLittleEndian
Declaration
public readonly bool IsLittleEndian { get; }
Property Value
Length
The total size of the buffer space this reader is working with.
Declaration
public readonly int Length { get; }
Property Value
Methods
GetBitsRead()
Declaration
Returns
GetBytesRead()
Declaration
public int GetBytesRead()
Returns
ReadByte()
Declaration
Returns
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.
|
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
ReadFixedString(Byte*, Int32)
Declaration
public ushort ReadFixedString(byte *data, int maxLength)
Parameters
Type |
Name |
Description |
Byte* |
data |
|
Int32 |
maxLength |
|
Returns
ReadFixedString128()
Declaration
public FixedString128Bytes ReadFixedString128()
Returns
ReadFixedString32()
Declaration
public FixedString32Bytes ReadFixedString32()
Returns
ReadFixedString4096()
Declaration
public FixedString4096Bytes ReadFixedString4096()
Returns
ReadFixedString512()
Declaration
public FixedString512Bytes ReadFixedString512()
Returns
ReadFixedString64()
Declaration
public FixedString64Bytes ReadFixedString64()
Returns
ReadFloat()
Declaration
Returns
ReadInt()
Declaration
Returns
ReadIntNetworkByteOrder()
Declaration
public int ReadIntNetworkByteOrder()
Returns
ReadLong()
Declaration
Returns
ReadPackedFixedString128Delta(FixedString128Bytes, NetworkCompressionModel)
Declaration
public FixedString128Bytes ReadPackedFixedString128Delta(FixedString128Bytes baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString32Delta(FixedString32Bytes, NetworkCompressionModel)
Declaration
public FixedString32Bytes ReadPackedFixedString32Delta(FixedString32Bytes baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString4096Delta(FixedString4096Bytes, NetworkCompressionModel)
Declaration
public FixedString4096Bytes ReadPackedFixedString4096Delta(FixedString4096Bytes baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString512Delta(FixedString512Bytes, NetworkCompressionModel)
Declaration
public FixedString512Bytes ReadPackedFixedString512Delta(FixedString512Bytes baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString64Delta(FixedString64Bytes, NetworkCompressionModel)
Declaration
public FixedString64Bytes ReadPackedFixedString64Delta(FixedString64Bytes baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedStringDelta(Byte*, Int32, Byte*, UInt16, NetworkCompressionModel)
Declaration
public ushort ReadPackedFixedStringDelta(byte *data, int maxLength, byte *baseData, ushort baseLength, NetworkCompressionModel model)
Parameters
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
ReadPackedLong(NetworkCompressionModel)
Declaration
public long ReadPackedLong(NetworkCompressionModel model)
Parameters
Returns
ReadPackedLongDelta(Int64, NetworkCompressionModel)
Declaration
public long ReadPackedLongDelta(long baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedUInt(NetworkCompressionModel)
Declaration
public uint ReadPackedUInt(NetworkCompressionModel model)
Parameters
Returns
ReadPackedUIntDelta(UInt32, NetworkCompressionModel)
Declaration
public uint ReadPackedUIntDelta(uint baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedULong(NetworkCompressionModel)
Declaration
public ulong ReadPackedULong(NetworkCompressionModel model)
Parameters
Returns
ReadPackedULongDelta(UInt64, NetworkCompressionModel)
Declaration
public ulong ReadPackedULongDelta(ulong baseline, NetworkCompressionModel model)
Parameters
Returns
ReadRawBits(Int32)
Declaration
public uint ReadRawBits(int numbits)
Parameters
Type |
Name |
Description |
Int32 |
numbits |
|
Returns
ReadShort()
Declaration
Returns
ReadShortNetworkByteOrder()
Declaration
public short ReadShortNetworkByteOrder()
Returns
ReadUInt()
Declaration
Returns
ReadUIntNetworkByteOrder()
Declaration
public uint ReadUIntNetworkByteOrder()
Returns
ReadULong()
Declaration
Returns
ReadUShort()
Declaration
public ushort ReadUShort()
Returns
ReadUShortNetworkByteOrder()
Declaration
public ushort ReadUShortNetworkByteOrder()
Returns
SeekSet(Int32)
Declaration
public void SeekSet(int pos)
Parameters
Type |
Name |
Description |
Int32 |
pos |
|