Skip to main content

MLAPI.Serialization.NetworkReader

A BinaryReader that can do bit wise manipulation when backed by a NetworkBuffer

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Inherited Members#

Object.Equals(Object)

Object.Equals(Object, Object)

Object.GetHashCode()

Object.GetType()

Object.MemberwiseClone()

Object.ReferenceEquals(Object, Object)

Object.ToString()

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public class NetworkReader

Constructors#

NetworkReader(Stream)#

Creates a new NetworkReader backed by a given stream

Declaration#

public NetworkReader(Stream stream)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to read from

Methods#

CreateArraySegment(Int32, Int32)#

CreateArraySegment Creates an array segment from the size and offset values passed in. If none are passed in, then it creates an array segment of the entire buffer.

Declaration#

public ArraySegment<byte> CreateArraySegment(int sizeToCopy = -1, int offset = -1)

Parameters#

TypeNameDescription
System.Int32sizeToCopysize to copy
System.Int32offsetoffset within the stream buffer to start copying

Returns#

TypeDescription
System.ArraySegment<System.Byte>ArraySegment<byte>

ReadBit()#

Reads a single bit

Declaration#

public bool ReadBit()

Returns#

TypeDescription
System.BooleanThe bit read

ReadBits(Int32)#

Read a certain amount of bits from the stream.

Declaration#

public ulong ReadBits(int bitCount)

Parameters#

TypeNameDescription
System.Int32bitCountHow many bits to read. Minimum 0, maximum 8.

Returns#

TypeDescription
System.UInt64The bits that were read

ReadBool()#

Reads a single bit

Declaration#

public bool ReadBool()

Returns#

TypeDescription
System.BooleanThe bit read

ReadByte()#

Reads a single byte

Declaration#

public int ReadByte()

Returns#

TypeDescription
System.Int32The byte read as an integer

ReadByteArray(Byte[], Int64)#

Read byte array into an optional buffer from the stream.

Declaration#

public byte[] ReadByteArray(byte[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Byte[]readToThe array to read into. If the array is not large enough or if it's null. A new array is created.
System.Int64knownLengthThe length of the array if it's known. Otherwise -1

Returns#

TypeDescription
System.Byte[]The byte array that has been read.

ReadByteArrayDiff(Byte[], Int64)#

Read byte array diff into an optional buffer from the stream.

Declaration#

public byte[] ReadByteArrayDiff(byte[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Byte[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe length of the array if it's known. Otherwise -1

Returns#

TypeDescription
System.Byte[]The byte array created from the diff and original.

ReadByteBits(Int32)#

Read a certain amount of bits from the stream.

Declaration#

public byte ReadByteBits(int bitCount)

Parameters#

TypeNameDescription
System.Int32bitCountHow many bits to read. Minimum 0, maximum 64.

Returns#

TypeDescription
System.ByteThe bits that were read

ReadByteDirect()#

Reads a byte

Declaration#

public byte ReadByteDirect()

Returns#

TypeDescription
System.ByteThe byte read

ReadChar()#

Read a single character from the stream

Declaration#

public char ReadChar()

Returns#

TypeDescription
System.CharValue read from stream.

ReadCharPacked()#

Read a varint two-byte character from the stream.

Declaration#

public char ReadCharPacked()

Returns#

TypeDescription
System.CharUn-varinted value.

ReadColor()#

Read a Color from the stream.

Declaration#

public Color ReadColor()

Returns#

TypeDescription
UnityEngine.ColorThe Color read from the stream.

ReadColor32()#

Read a Color32 from the stream.

Declaration#

public Color32 ReadColor32()

Returns#

TypeDescription
UnityEngine.Color32The Color32 read from the stream.

ReadColorPacked()#

Read a Color from the stream.

Declaration#

public Color ReadColorPacked()

Returns#

TypeDescription
UnityEngine.ColorThe Color read from the stream.

ReadDouble()#

Read a double-precision floating point value from the stream.

Declaration#

public double ReadDouble()

Returns#

TypeDescription
System.DoubleThe read value

ReadDoubleArray(Double[], Int64)#

Read double array from the stream.

Declaration#

public double[] ReadDoubleArray(double[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Double[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Double[]The array read from the stream.

ReadDoubleArrayDiff(Double[], Int64)#

Read double array diff from the stream.

Declaration#

public double[] ReadDoubleArrayDiff(double[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Double[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Double[]The array created from the diff and the current version.

ReadDoubleArrayPacked(Double[], Int64)#

Read double array in a packed format from the stream.

Declaration#

public double[] ReadDoubleArrayPacked(double[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Double[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Double[]The array read from the stream.

ReadDoubleArrayPackedDiff(Double[], Int64)#

Read double array diff in a packed format from the stream.

Declaration#

public double[] ReadDoubleArrayPackedDiff(double[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Double[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Double[]The array created from the diff and the current version.

ReadDoublePacked()#

Read a double-precision floating point value from the stream as a varint

Declaration#

public double ReadDoublePacked()

Returns#

TypeDescription
System.DoubleThe read value

ReadFloatArray(Single[], Int64)#

Read float array from the stream.

Declaration#

public float[] ReadFloatArray(float[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Single[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Single[]The array read from the stream.

ReadFloatArrayDiff(Single[], Int64)#

Read float array diff from the stream.

Declaration#

public float[] ReadFloatArrayDiff(float[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Single[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Single[]The array created from the diff and the current version.

ReadFloatArrayPacked(Single[], Int64)#

Read float array in a packed format from the stream.

Declaration#

public float[] ReadFloatArrayPacked(float[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Single[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Single[]The array read from the stream.

ReadFloatArrayPackedDiff(Single[], Int64)#

Read float array diff in a packed format from the stream.

Declaration#

public float[] ReadFloatArrayPackedDiff(float[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Single[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Single[]The array created from the diff and the current version.

ReadInt16()#

Read a signed short (Int16) from the stream.

Declaration#

public short ReadInt16()

Returns#

TypeDescription
System.Int16Value read from stream.

ReadInt16Packed()#

Read a ZigZag encoded varint signed short (Int16) from the stream.

Declaration#

public short ReadInt16Packed()

Returns#

TypeDescription
System.Int16Decoded un-varinted value.

ReadInt32()#

Read a signed int (Int32) from the stream.

Declaration#

public int ReadInt32()

Returns#

TypeDescription
System.Int32Value read from stream.

ReadInt32Packed()#

Read a ZigZag encoded varint signed int (Int32) from the stream.

Declaration#

public int ReadInt32Packed()

Returns#

TypeDescription
System.Int32Decoded un-varinted value.

ReadInt64()#

Read a signed long (Int64) from the stream.

Declaration#

public long ReadInt64()

Returns#

TypeDescription
System.Int64Value read from stream.

ReadInt64Packed()#

Read a ZigZag encoded varint signed long(Int64) from the stream.

Declaration#

public long ReadInt64Packed()

Returns#

TypeDescription
System.Int64Decoded un-varinted value.

ReadIntArray(Int32[], Int64)#

Read int array from the stream.

Declaration#

public int[] ReadIntArray(int[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int32[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int32[]The array read from the stream.

ReadIntArrayDiff(Int32[], Int64)#

Read int array diff from the stream.

Declaration#

public int[] ReadIntArrayDiff(int[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int32[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int32[]The array created from the diff and the current version.

ReadIntArrayPacked(Int32[], Int64)#

Read int array in a packed format from the stream.

Declaration#

public int[] ReadIntArrayPacked(int[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int32[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int32[]The array read from the stream.

ReadIntArrayPackedDiff(Int32[], Int64)#

Read int array diff in a packed format from the stream.

Declaration#

public int[] ReadIntArrayPackedDiff(int[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int32[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int32[]The array created from the diff and the current version.

ReadLongArray(Int64[], Int64)#

Read long array from the stream.

Declaration#

public long[] ReadLongArray(long[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int64[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int64[]The array read from the stream.

ReadLongArrayDiff(Int64[], Int64)#

Read long array diff from the stream.

Declaration#

public long[] ReadLongArrayDiff(long[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int64[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int64[]The array created from the diff and the current version.

ReadLongArrayPacked(Int64[], Int64)#

Read long array in a packed format from the stream.

Declaration#

public long[] ReadLongArrayPacked(long[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int64[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int64[]The array read from the stream.

ReadLongArrayPackedDiff(Int64[], Int64)#

Read long array diff in a packed format from the stream.

Declaration#

public long[] ReadLongArrayPackedDiff(long[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int64[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int64[]The array created from the diff and the current version.

ReadNibble()#

Read a nibble (4 bits) from the stream.

Declaration#

public byte ReadNibble()

Returns#

TypeDescription
System.ByteThe nibble that was read

ReadNibble(Boolean)#

Read a nibble (4 bits) from the stream.

Declaration#

public byte ReadNibble(bool asUpper)

Parameters#

TypeNameDescription
System.BooleanasUpperWhether or not the nibble should be left-shifted by 4 bits

Returns#

TypeDescription
System.ByteThe nibble that was read

ReadObjectPacked(Type)#

Reads a single boxed object of a given type in a packed format

Declaration#

public object ReadObjectPacked(Type type)

Parameters#

TypeNameDescription
System.TypetypeThe type to read

Returns#

TypeDescription
System.ObjectReturns the boxed read object

ReadRangedDouble(Double, Double, Int32)#

read a double-precision floating point value from the stream. The value is between (inclusive) the minValue and maxValue.

Declaration#

public double ReadRangedDouble(double minValue, double maxValue, int bytes)

Parameters#

TypeNameDescription
System.DoubleminValueMinimum value that this value could be
System.DoublemaxValueMaximum possible value that this could be
System.Int32bytesHow many bytes the compressed value occupies. Must be between 1 and 8 (inclusive)

Returns#

TypeDescription
System.DoubleThe read value

ReadRangedSingle(Single, Single, Int32)#

Read a single-precision floating point value from the stream. The value is between (inclusive) the minValue and maxValue.

Declaration#

public float ReadRangedSingle(float minValue, float maxValue, int bytes)

Parameters#

TypeNameDescription
System.SingleminValueMinimum value that this value could be
System.SinglemaxValueMaximum possible value that this could be
System.Int32bytesHow many bytes the compressed value occupies. Must be between 1 and 4 (inclusive)

Returns#

TypeDescription
System.SingleThe read value

ReadRay()#

Read a Ray from the stream.

Declaration#

public Ray ReadRay()

Returns#

TypeDescription
UnityEngine.RayThe Ray read from the stream.

ReadRay2D()#

Read a Ray2D from the stream.

Declaration#

public Ray2D ReadRay2D()

Returns#

TypeDescription
UnityEngine.Ray2DThe Ray2D read from the stream.

ReadRay2DPacked()#

Read a Ray2D from the stream.

Declaration#

public Ray2D ReadRay2DPacked()

Returns#

TypeDescription
UnityEngine.Ray2DThe Ray2D read from the stream.

ReadRayPacked()#

Read a Ray from the stream.

Declaration#

public Ray ReadRayPacked()

Returns#

TypeDescription
UnityEngine.RayThe Ray read from the stream.

ReadRotation()#

Reads the rotation from the stream

Declaration#

public Quaternion ReadRotation()

Returns#

TypeDescription
UnityEngine.QuaternionThe rotation read from the stream

ReadRotationPacked()#

Reads the rotation from the stream

Declaration#

public Quaternion ReadRotationPacked()

Returns#

TypeDescription
UnityEngine.QuaternionThe rotation read from the stream

ReadSByte()#

Reads a signed byte

Declaration#

public sbyte ReadSByte()

Returns#

TypeDescription
System.SByteValue read from stream.

ReadShortArray(Int16[], Int64)#

Read short array from the stream.

Declaration#

public short[] ReadShortArray(short[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int16[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int16[]The array read from the stream.

ReadShortArrayDiff(Int16[], Int64)#

Read short array diff from the stream.

Declaration#

public short[] ReadShortArrayDiff(short[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int16[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int16[]The array created from the diff and the current version.

ReadShortArrayPacked(Int16[], Int64)#

Read short array in a packed format from the stream.

Declaration#

public short[] ReadShortArrayPacked(short[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int16[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int16[]The array read from the stream.

ReadShortArrayPackedDiff(Int16[], Int64)#

Read short array diff in a packed format from the stream.

Declaration#

public short[] ReadShortArrayPackedDiff(short[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.Int16[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.Int16[]The array created from the diff and the current version.

ReadSingle()#

Read a single-precision floating point value from the stream.

Declaration#

public float ReadSingle()

Returns#

TypeDescription
System.SingleThe read value

ReadSinglePacked()#

Read a single-precision floating point value from the stream from a varint

Declaration#

public float ReadSinglePacked()

Returns#

TypeDescription
System.SingleThe read value

ReadString(Boolean)#

Read a string from the stream.

Declaration#

public StringBuilder ReadString(bool oneByteChars)

Parameters#

TypeNameDescription
System.BooleanoneByteCharsIf set to true one byte chars are used and only ASCII is supported.

Returns#

TypeDescription
System.Text.StringBuilderThe string that was read.

ReadString(StringBuilder, Boolean)#

Read a string from the stream.

Declaration#

public StringBuilder ReadString(StringBuilder builder = null, bool oneByteChars = false)

Parameters#

TypeNameDescription
System.Text.StringBuilderbuilderThe builder to read the values into or null to use a new builder.
System.BooleanoneByteCharsIf set to true one byte chars are used and only ASCII is supported.

Returns#

TypeDescription
System.Text.StringBuilderThe string that was read.

ReadStringDiff(String, Boolean)#

Read string diff from the stream.

Declaration#

public StringBuilder ReadStringDiff(string compare, bool oneByteChars = false)

Parameters#

TypeNameDescription
System.StringcompareThe version to compare the diff to.
System.BooleanoneByteCharsIf set to true one byte chars are used and only ASCII is supported.

Returns#

TypeDescription
System.Text.StringBuilderThe string based on the diff and the old version.

ReadStringDiff(StringBuilder, Boolean)#

Read string diff from the stream.

Declaration#

public StringBuilder ReadStringDiff(StringBuilder compareAndBuffer, bool oneByteChars = false)

Parameters#

TypeNameDescription
System.Text.StringBuildercompareAndBufferThe builder containing the current version and that will also be used as the output buffer.
System.BooleanoneByteCharsIf set to true one byte chars will be used and only ASCII will be supported.

Returns#

TypeDescription
System.Text.StringBuilderThe string based on the diff and the old version.

ReadStringDiff(StringBuilder, String, Boolean)#

Read string diff from the stream.

Declaration#

public StringBuilder ReadStringDiff(StringBuilder builder, string compare, bool oneByteChars = false)

Parameters#

TypeNameDescription
System.Text.StringBuilderbuilderThe builder to read the string into or null to use a new builder.
System.StringcompareThe version to compare the diff to.
System.BooleanoneByteCharsIf set to true one byte chars are used and only ASCII is supported.

Returns#

TypeDescription
System.Text.StringBuilderThe string based on the diff and the old version

ReadStringPacked(StringBuilder)#

Read string encoded as a varint from the stream.

Declaration#

public string ReadStringPacked(StringBuilder builder = null)

Parameters#

TypeNameDescription
System.Text.StringBuilderbuilderThe builder to read the string into or null to use a new builder

Returns#

TypeDescription
System.StringThe string that was read.

ReadStringPackedDiff(String)#

Read string diff encoded as varints from the stream.

Declaration#

public StringBuilder ReadStringPackedDiff(string compare)

Parameters#

TypeNameDescription
System.StringcompareThe version to compare the diff to.

Returns#

TypeDescription
System.Text.StringBuilderThe string based on the diff and the old version.

ReadStringPackedDiff(StringBuilder)#

Read string diff encoded as varints from the stream.

Declaration#

public StringBuilder ReadStringPackedDiff(StringBuilder compareAndBuffer)

Parameters#

TypeNameDescription
System.Text.StringBuildercompareAndBufferThe builder containing the current version and that will also be used as the output buffer.

Returns#

TypeDescription
System.Text.StringBuilderThe string based on the diff and the old version.

ReadStringPackedDiff(StringBuilder, String)#

Read string diff encoded as varints from the stream.

Declaration#

public StringBuilder ReadStringPackedDiff(StringBuilder builder, string compare)

Parameters#

TypeNameDescription
System.Text.StringBuilderbuilderThe builder to read the string into or null to use a new builder.
System.StringcompareThe version to compare the diff to.

Returns#

TypeDescription
System.Text.StringBuilderThe string based on the diff and the old version

ReadUInt16()#

Read an unsigned short (UInt16) from the stream.

Declaration#

public ushort ReadUInt16()

Returns#

TypeDescription
System.UInt16Value read from stream.

ReadUInt16Packed()#

Read a varint unsigned short (UInt16) from the stream.

Declaration#

public ushort ReadUInt16Packed()

Returns#

TypeDescription
System.UInt16Un-varinted value.

ReadUInt32()#

Read an unsigned int (UInt32) from the stream.

Declaration#

public uint ReadUInt32()

Returns#

TypeDescription
System.UInt32Value read from stream.

ReadUInt32Packed()#

Read a varint unsigned int (UInt32) from the stream.

Declaration#

public uint ReadUInt32Packed()

Returns#

TypeDescription
System.UInt32Un-varinted value.

ReadUInt64()#

Read an unsigned long (UInt64) from the stream.

Declaration#

public ulong ReadUInt64()

Returns#

TypeDescription
System.UInt64Value read from stream.

ReadUInt64Packed()#

Read a varint unsigned long (UInt64) from the stream.

Declaration#

public ulong ReadUInt64Packed()

Returns#

TypeDescription
System.UInt64Un-varinted value.

ReadUIntArray(UInt32[], Int64)#

Read uint array from the stream.

Declaration#

public uint[] ReadUIntArray(uint[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt32[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt32[]The array read from the stream.

ReadUIntArrayDiff(UInt32[], Int64)#

Read uint array diff from the stream.

Declaration#

public uint[] ReadUIntArrayDiff(uint[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt32[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt32[]The array created from the diff and the current version.

ReadUIntArrayPacked(UInt32[], Int64)#

Read uint array in a packed format from the stream.

Declaration#

public uint[] ReadUIntArrayPacked(uint[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt32[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt32[]The array read from the stream.

ReadULongArray(UInt64[], Int64)#

Read ulong array from the stream.

Declaration#

public ulong[] ReadULongArray(ulong[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt64[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt64[]The array read from the stream.

ReadULongArrayDiff(UInt64[], Int64)#

Read ulong array diff from the stream.

Declaration#

public ulong[] ReadULongArrayDiff(ulong[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt64[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt64[]The array created from the diff and the current version.

ReadULongArrayPacked(UInt64[], Int64)#

Read ulong array in a packed format from the stream.

Declaration#

public ulong[] ReadULongArrayPacked(ulong[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt64[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt64[]The array read from the stream.

ReadULongArrayPackedDiff(UInt64[], Int64)#

Read ulong array diff in a packed format from the stream.

Declaration#

public ulong[] ReadULongArrayPackedDiff(ulong[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt64[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt64[]The array created from the diff and the current version.

ReadUShortArray(UInt16[], Int64)#

Read ushort array from the stream.

Declaration#

public ushort[] ReadUShortArray(ushort[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt16[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt16[]The array read from the stream.

ReadUShortArrayDiff(UInt16[], Int64)#

Read ushort array diff from the stream.

Declaration#

public ushort[] ReadUShortArrayDiff(ushort[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt16[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt16[]The array created from the diff and the current version.

ReadUShortArrayPacked(UInt16[], Int64)#

Read ushort array in a packed format from the stream.

Declaration#

public ushort[] ReadUShortArrayPacked(ushort[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt16[]readToThe buffer to read into or null to create a new array
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt16[]The array read from the stream.

ReadUShortArrayPackedDiff(UInt16[], Int64)#

Read ushort array diff in a packed format from the stream.

Declaration#

public ushort[] ReadUShortArrayPackedDiff(ushort[] readTo = null, long knownLength = -1L)

Parameters#

TypeNameDescription
System.UInt16[]readToThe buffer containing the old version or null.
System.Int64knownLengthThe known length or -1 if unknown

Returns#

TypeDescription
System.UInt16[]The array created from the diff and the current version.

ReadVector2()#

Read a Vector2 from the stream.

Declaration#

public Vector2 ReadVector2()

Returns#

TypeDescription
UnityEngine.Vector2The Vector2 read from the stream.

ReadVector2Packed()#

Read a Vector2 from the stream.

Declaration#

public Vector2 ReadVector2Packed()

Returns#

TypeDescription
UnityEngine.Vector2The Vector2 read from the stream.

ReadVector3()#

Read a Vector3 from the stream.

Declaration#

public Vector3 ReadVector3()

Returns#

TypeDescription
UnityEngine.Vector3The Vector3 read from the stream.

ReadVector3Packed()#

Read a Vector3 from the stream.

Declaration#

public Vector3 ReadVector3Packed()

Returns#

TypeDescription
UnityEngine.Vector3The Vector3 read from the stream.

ReadVector4()#

Read a Vector4 from the stream.

Declaration#

public Vector4 ReadVector4()

Returns#

TypeDescription
UnityEngine.Vector4The Vector4 read from the stream.

ReadVector4Packed()#

Read a Vector4 from the stream.

Declaration#

public Vector4 ReadVector4Packed()

Returns#

TypeDescription
UnityEngine.Vector4The Vector4 read from the stream.

SetStream(Stream)#

Changes the underlying stream the reader is reading from

Declaration#

public void SetStream(Stream stream)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to read from

SkipPadBits()#

Skips pad bits and aligns the position to the next byte

Declaration#

public void SkipPadBits()