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
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(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 FixedString128 ReadFixedString128()
Returns
ReadFixedString32()
Declaration
public FixedString32 ReadFixedString32()
Returns
ReadFixedString4096()
Declaration
public FixedString4096 ReadFixedString4096()
Returns
ReadFixedString512()
Declaration
public FixedString512 ReadFixedString512()
Returns
ReadFixedString64()
Declaration
public FixedString64 ReadFixedString64()
Returns
ReadFloat()
Declaration
Returns
ReadInt()
Declaration
Returns
ReadIntNetworkByteOrder()
Declaration
public int ReadIntNetworkByteOrder()
Returns
ReadPackedFixedString128Delta(FixedString128, NetworkCompressionModel)
Declaration
public FixedString128 ReadPackedFixedString128Delta(FixedString128 baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString32Delta(FixedString32, NetworkCompressionModel)
Declaration
public FixedString32 ReadPackedFixedString32Delta(FixedString32 baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString4096Delta(FixedString4096, NetworkCompressionModel)
Declaration
public FixedString4096 ReadPackedFixedString4096Delta(FixedString4096 baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString512Delta(FixedString512, NetworkCompressionModel)
Declaration
public FixedString512 ReadPackedFixedString512Delta(FixedString512 baseline, NetworkCompressionModel model)
Parameters
Returns
ReadPackedFixedString64Delta(FixedString64, NetworkCompressionModel)
Declaration
public FixedString64 ReadPackedFixedString64Delta(FixedString64 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
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
ReadUInt()
Declaration
Returns
ReadUIntNetworkByteOrder()
Declaration
public uint ReadUIntNetworkByteOrder()
Returns
ReadULong()
Declaration
Returns
ReadUShort()
Declaration
public ushort ReadUShort()
Returns
ReadUShortNetworkByteOrder()
Declaration
public ushort ReadUShortNetworkByteOrder()
Returns
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.