docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class NetworkReader

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

    Inheritance
    object
    NetworkReader
    PooledNetworkReader
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: MLAPI.Serialization
    Assembly: Unity.Multiplayer.MLAPI.Runtime.dll
    Syntax
    public class NetworkReader

    Constructors

    NetworkReader(Stream)

    Creates a new NetworkReader backed by a given stream

    Declaration
    public NetworkReader(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream to read from

    Methods

    CreateArraySegment(int, int)

    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
    Type Name Description
    int sizeToCopy

    size to copy

    int offset

    offset within the stream buffer to start copying

    Returns
    Type Description
    ArraySegment<byte>

    ArraySegment<byte>

    ReadBit()

    Reads a single bit

    Declaration
    public bool ReadBit()
    Returns
    Type Description
    bool

    The bit read

    ReadBits(int)

    Read a certain amount of bits from the stream.

    Declaration
    public ulong ReadBits(int bitCount)
    Parameters
    Type Name Description
    int bitCount

    How many bits to read. Minimum 0, maximum 8.

    Returns
    Type Description
    ulong

    The bits that were read

    ReadBool()

    Reads a single bit

    Declaration
    public bool ReadBool()
    Returns
    Type Description
    bool

    The bit read

    ReadByte()

    Reads a single byte

    Declaration
    public int ReadByte()
    Returns
    Type Description
    int

    The byte read as an integer

    ReadByteArray(byte[], long)

    Read byte array into an optional buffer from the stream.

    Declaration
    public byte[] ReadByteArray(byte[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    byte[] readTo

    The array to read into. If the array is not large enough or if it's null. A new array is created.

    long knownLength

    The length of the array if it's known. Otherwise -1

    Returns
    Type Description
    byte[]

    The byte array that has been read.

    ReadByteArrayDiff(byte[], long)

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

    Declaration
    public byte[] ReadByteArrayDiff(byte[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    byte[] readTo

    The buffer containing the old version or null.

    long knownLength

    The length of the array if it's known. Otherwise -1

    Returns
    Type Description
    byte[]

    The byte array created from the diff and original.

    ReadByteBits(int)

    Read a certain amount of bits from the stream.

    Declaration
    public byte ReadByteBits(int bitCount)
    Parameters
    Type Name Description
    int bitCount

    How many bits to read. Minimum 0, maximum 64.

    Returns
    Type Description
    byte

    The bits that were read

    ReadByteDirect()

    Reads a byte

    Declaration
    public byte ReadByteDirect()
    Returns
    Type Description
    byte

    The byte read

    ReadChar()

    Read a single character from the stream

    Declaration
    public char ReadChar()
    Returns
    Type Description
    char

    Value read from stream.

    ReadCharPacked()

    Read a varint two-byte character from the stream.

    Declaration
    public char ReadCharPacked()
    Returns
    Type Description
    char

    Un-varinted value.

    ReadColor()

    Read a Color from the stream.

    Declaration
    public Color ReadColor()
    Returns
    Type Description
    Color

    The Color read from the stream.

    ReadColor32()

    Read a Color32 from the stream.

    Declaration
    public Color32 ReadColor32()
    Returns
    Type Description
    Color32

    The Color32 read from the stream.

    ReadColorPacked()

    Read a Color from the stream.

    Declaration
    public Color ReadColorPacked()
    Returns
    Type Description
    Color

    The Color read from the stream.

    ReadDouble()

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

    Declaration
    public double ReadDouble()
    Returns
    Type Description
    double

    The read value

    ReadDoubleArray(double[], long)

    Read double array from the stream.

    Declaration
    public double[] ReadDoubleArray(double[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    double[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    double[]

    The array read from the stream.

    ReadDoubleArrayDiff(double[], long)

    Read double array diff from the stream.

    Declaration
    public double[] ReadDoubleArrayDiff(double[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    double[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    double[]

    The array created from the diff and the current version.

    ReadDoubleArrayPacked(double[], long)

    Read double array in a packed format from the stream.

    Declaration
    public double[] ReadDoubleArrayPacked(double[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    double[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    double[]

    The array read from the stream.

    ReadDoubleArrayPackedDiff(double[], long)

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

    Declaration
    public double[] ReadDoubleArrayPackedDiff(double[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    double[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    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
    Type Description
    double

    The read value

    ReadFloatArray(float[], long)

    Read float array from the stream.

    Declaration
    public float[] ReadFloatArray(float[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    float[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    float[]

    The array read from the stream.

    ReadFloatArrayDiff(float[], long)

    Read float array diff from the stream.

    Declaration
    public float[] ReadFloatArrayDiff(float[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    float[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    float[]

    The array created from the diff and the current version.

    ReadFloatArrayPacked(float[], long)

    Read float array in a packed format from the stream.

    Declaration
    public float[] ReadFloatArrayPacked(float[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    float[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    float[]

    The array read from the stream.

    ReadFloatArrayPackedDiff(float[], long)

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

    Declaration
    public float[] ReadFloatArrayPackedDiff(float[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    float[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    float[]

    The array created from the diff and the current version.

    ReadInt16()

    Read a signed short (Int16) from the stream.

    Declaration
    public short ReadInt16()
    Returns
    Type Description
    short

    Value read from stream.

    ReadInt16Packed()

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

    Declaration
    public short ReadInt16Packed()
    Returns
    Type Description
    short

    Decoded un-varinted value.

    ReadInt32()

    Read a signed int (Int32) from the stream.

    Declaration
    public int ReadInt32()
    Returns
    Type Description
    int

    Value read from stream.

    ReadInt32Packed()

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

    Declaration
    public int ReadInt32Packed()
    Returns
    Type Description
    int

    Decoded un-varinted value.

    ReadInt64()

    Read a signed long (Int64) from the stream.

    Declaration
    public long ReadInt64()
    Returns
    Type Description
    long

    Value read from stream.

    ReadInt64Packed()

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

    Declaration
    public long ReadInt64Packed()
    Returns
    Type Description
    long

    Decoded un-varinted value.

    ReadIntArray(int[], long)

    Read int array from the stream.

    Declaration
    public int[] ReadIntArray(int[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    int[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    int[]

    The array read from the stream.

    ReadIntArrayDiff(int[], long)

    Read int array diff from the stream.

    Declaration
    public int[] ReadIntArrayDiff(int[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    int[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    int[]

    The array created from the diff and the current version.

    ReadIntArrayPacked(int[], long)

    Read int array in a packed format from the stream.

    Declaration
    public int[] ReadIntArrayPacked(int[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    int[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    int[]

    The array read from the stream.

    ReadIntArrayPackedDiff(int[], long)

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

    Declaration
    public int[] ReadIntArrayPackedDiff(int[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    int[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    int[]

    The array created from the diff and the current version.

    ReadLongArray(long[], long)

    Read long array from the stream.

    Declaration
    public long[] ReadLongArray(long[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    long[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    long[]

    The array read from the stream.

    ReadLongArrayDiff(long[], long)

    Read long array diff from the stream.

    Declaration
    public long[] ReadLongArrayDiff(long[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    long[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    long[]

    The array created from the diff and the current version.

    ReadLongArrayPacked(long[], long)

    Read long array in a packed format from the stream.

    Declaration
    public long[] ReadLongArrayPacked(long[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    long[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    long[]

    The array read from the stream.

    ReadLongArrayPackedDiff(long[], long)

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

    Declaration
    public long[] ReadLongArrayPackedDiff(long[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    long[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    long[]

    The array created from the diff and the current version.

    ReadNibble()

    Read a nibble (4 bits) from the stream.

    Declaration
    public byte ReadNibble()
    Returns
    Type Description
    byte

    The nibble that was read

    ReadNibble(bool)

    Read a nibble (4 bits) from the stream.

    Declaration
    public byte ReadNibble(bool asUpper)
    Parameters
    Type Name Description
    bool asUpper

    Whether or not the nibble should be left-shifted by 4 bits

    Returns
    Type Description
    byte

    The 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
    Type Name Description
    Type type

    The type to read

    Returns
    Type Description
    object

    Returns the boxed read object

    ReadRangedDouble(double, double, int)

    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
    Type Name Description
    double minValue

    Minimum value that this value could be

    double maxValue

    Maximum possible value that this could be

    int bytes

    How many bytes the compressed value occupies. Must be between 1 and 8 (inclusive)

    Returns
    Type Description
    double

    The read value

    ReadRangedSingle(float, float, int)

    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
    Type Name Description
    float minValue

    Minimum value that this value could be

    float maxValue

    Maximum possible value that this could be

    int bytes

    How many bytes the compressed value occupies. Must be between 1 and 4 (inclusive)

    Returns
    Type Description
    float

    The read value

    ReadRay()

    Read a Ray from the stream.

    Declaration
    public Ray ReadRay()
    Returns
    Type Description
    Ray

    The Ray read from the stream.

    ReadRay2D()

    Read a Ray2D from the stream.

    Declaration
    public Ray2D ReadRay2D()
    Returns
    Type Description
    Ray2D

    The Ray2D read from the stream.

    ReadRay2DPacked()

    Read a Ray2D from the stream.

    Declaration
    public Ray2D ReadRay2DPacked()
    Returns
    Type Description
    Ray2D

    The Ray2D read from the stream.

    ReadRayPacked()

    Read a Ray from the stream.

    Declaration
    public Ray ReadRayPacked()
    Returns
    Type Description
    Ray

    The Ray read from the stream.

    ReadRotation()

    Reads the rotation from the stream

    Declaration
    public Quaternion ReadRotation()
    Returns
    Type Description
    Quaternion

    The rotation read from the stream

    ReadRotationPacked()

    Reads the rotation from the stream

    Declaration
    public Quaternion ReadRotationPacked()
    Returns
    Type Description
    Quaternion

    The rotation read from the stream

    ReadSByte()

    Reads a signed byte

    Declaration
    public sbyte ReadSByte()
    Returns
    Type Description
    sbyte

    Value read from stream.

    ReadShortArray(short[], long)

    Read short array from the stream.

    Declaration
    public short[] ReadShortArray(short[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    short[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    short[]

    The array read from the stream.

    ReadShortArrayDiff(short[], long)

    Read short array diff from the stream.

    Declaration
    public short[] ReadShortArrayDiff(short[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    short[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    short[]

    The array created from the diff and the current version.

    ReadShortArrayPacked(short[], long)

    Read short array in a packed format from the stream.

    Declaration
    public short[] ReadShortArrayPacked(short[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    short[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    short[]

    The array read from the stream.

    ReadShortArrayPackedDiff(short[], long)

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

    Declaration
    public short[] ReadShortArrayPackedDiff(short[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    short[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    short[]

    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
    Type Description
    float

    The read value

    ReadSinglePacked()

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

    Declaration
    public float ReadSinglePacked()
    Returns
    Type Description
    float

    The read value

    ReadString(bool)

    Read a string from the stream.

    Declaration
    public StringBuilder ReadString(bool oneByteChars)
    Parameters
    Type Name Description
    bool oneByteChars

    If set to true one byte chars are used and only ASCII is supported.

    Returns
    Type Description
    StringBuilder

    The string that was read.

    ReadString(StringBuilder, bool)

    Read a string from the stream.

    Declaration
    public StringBuilder ReadString(StringBuilder builder = null, bool oneByteChars = false)
    Parameters
    Type Name Description
    StringBuilder builder

    The builder to read the values into or null to use a new builder.

    bool oneByteChars

    If set to true one byte chars are used and only ASCII is supported.

    Returns
    Type Description
    StringBuilder

    The string that was read.

    ReadStringDiff(string, bool)

    Read string diff from the stream.

    Declaration
    public StringBuilder ReadStringDiff(string compare, bool oneByteChars = false)
    Parameters
    Type Name Description
    string compare

    The version to compare the diff to.

    bool oneByteChars

    If set to true one byte chars are used and only ASCII is supported.

    Returns
    Type Description
    StringBuilder

    The string based on the diff and the old version.

    ReadStringDiff(StringBuilder, bool)

    Read string diff from the stream.

    Declaration
    public StringBuilder ReadStringDiff(StringBuilder compareAndBuffer, bool oneByteChars = false)
    Parameters
    Type Name Description
    StringBuilder compareAndBuffer

    The builder containing the current version and that will also be used as the output buffer.

    bool oneByteChars

    If set to true one byte chars will be used and only ASCII will be supported.

    Returns
    Type Description
    StringBuilder

    The string based on the diff and the old version.

    ReadStringDiff(StringBuilder, string, bool)

    Read string diff from the stream.

    Declaration
    public StringBuilder ReadStringDiff(StringBuilder builder, string compare, bool oneByteChars = false)
    Parameters
    Type Name Description
    StringBuilder builder

    The builder to read the string into or null to use a new builder.

    string compare

    The version to compare the diff to.

    bool oneByteChars

    If set to true one byte chars are used and only ASCII is supported.

    Returns
    Type Description
    StringBuilder

    The 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
    Type Name Description
    StringBuilder builder

    The builder to read the string into or null to use a new builder

    Returns
    Type Description
    string

    The string that was read.

    ReadStringPackedDiff(string)

    Read string diff encoded as varints from the stream.

    Declaration
    public StringBuilder ReadStringPackedDiff(string compare)
    Parameters
    Type Name Description
    string compare

    The version to compare the diff to.

    Returns
    Type Description
    StringBuilder

    The 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
    Type Name Description
    StringBuilder compareAndBuffer

    The builder containing the current version and that will also be used as the output buffer.

    Returns
    Type Description
    StringBuilder

    The 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
    Type Name Description
    StringBuilder builder

    The builder to read the string into or null to use a new builder.

    string compare

    The version to compare the diff to.

    Returns
    Type Description
    StringBuilder

    The string based on the diff and the old version

    ReadUInt16()

    Read an unsigned short (UInt16) from the stream.

    Declaration
    public ushort ReadUInt16()
    Returns
    Type Description
    ushort

    Value read from stream.

    ReadUInt16Packed()

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

    Declaration
    public ushort ReadUInt16Packed()
    Returns
    Type Description
    ushort

    Un-varinted value.

    ReadUInt32()

    Read an unsigned int (UInt32) from the stream.

    Declaration
    public uint ReadUInt32()
    Returns
    Type Description
    uint

    Value read from stream.

    ReadUInt32Packed()

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

    Declaration
    public uint ReadUInt32Packed()
    Returns
    Type Description
    uint

    Un-varinted value.

    ReadUInt64()

    Read an unsigned long (UInt64) from the stream.

    Declaration
    public ulong ReadUInt64()
    Returns
    Type Description
    ulong

    Value read from stream.

    ReadUInt64Packed()

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

    Declaration
    public ulong ReadUInt64Packed()
    Returns
    Type Description
    ulong

    Un-varinted value.

    ReadUIntArray(uint[], long)

    Read uint array from the stream.

    Declaration
    public uint[] ReadUIntArray(uint[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    uint[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    uint[]

    The array read from the stream.

    ReadUIntArrayDiff(uint[], long)

    Read uint array diff from the stream.

    Declaration
    public uint[] ReadUIntArrayDiff(uint[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    uint[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    uint[]

    The array created from the diff and the current version.

    ReadUIntArrayPacked(uint[], long)

    Read uint array in a packed format from the stream.

    Declaration
    public uint[] ReadUIntArrayPacked(uint[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    uint[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    uint[]

    The array read from the stream.

    ReadULongArray(ulong[], long)

    Read ulong array from the stream.

    Declaration
    public ulong[] ReadULongArray(ulong[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ulong[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ulong[]

    The array read from the stream.

    ReadULongArrayDiff(ulong[], long)

    Read ulong array diff from the stream.

    Declaration
    public ulong[] ReadULongArrayDiff(ulong[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ulong[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ulong[]

    The array created from the diff and the current version.

    ReadULongArrayPacked(ulong[], long)

    Read ulong array in a packed format from the stream.

    Declaration
    public ulong[] ReadULongArrayPacked(ulong[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ulong[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ulong[]

    The array read from the stream.

    ReadULongArrayPackedDiff(ulong[], long)

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

    Declaration
    public ulong[] ReadULongArrayPackedDiff(ulong[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ulong[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ulong[]

    The array created from the diff and the current version.

    ReadUShortArray(ushort[], long)

    Read ushort array from the stream.

    Declaration
    public ushort[] ReadUShortArray(ushort[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ushort[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ushort[]

    The array read from the stream.

    ReadUShortArrayDiff(ushort[], long)

    Read ushort array diff from the stream.

    Declaration
    public ushort[] ReadUShortArrayDiff(ushort[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ushort[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ushort[]

    The array created from the diff and the current version.

    ReadUShortArrayPacked(ushort[], long)

    Read ushort array in a packed format from the stream.

    Declaration
    public ushort[] ReadUShortArrayPacked(ushort[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ushort[] readTo

    The buffer to read into or null to create a new array

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ushort[]

    The array read from the stream.

    ReadUShortArrayPackedDiff(ushort[], long)

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

    Declaration
    public ushort[] ReadUShortArrayPackedDiff(ushort[] readTo = null, long knownLength = -1)
    Parameters
    Type Name Description
    ushort[] readTo

    The buffer containing the old version or null.

    long knownLength

    The known length or -1 if unknown

    Returns
    Type Description
    ushort[]

    The array created from the diff and the current version.

    ReadVector2()

    Read a Vector2 from the stream.

    Declaration
    public Vector2 ReadVector2()
    Returns
    Type Description
    Vector2

    The Vector2 read from the stream.

    ReadVector2Packed()

    Read a Vector2 from the stream.

    Declaration
    public Vector2 ReadVector2Packed()
    Returns
    Type Description
    Vector2

    The Vector2 read from the stream.

    ReadVector3()

    Read a Vector3 from the stream.

    Declaration
    public Vector3 ReadVector3()
    Returns
    Type Description
    Vector3

    The Vector3 read from the stream.

    ReadVector3Packed()

    Read a Vector3 from the stream.

    Declaration
    public Vector3 ReadVector3Packed()
    Returns
    Type Description
    Vector3

    The Vector3 read from the stream.

    ReadVector4()

    Read a Vector4 from the stream.

    Declaration
    public Vector4 ReadVector4()
    Returns
    Type Description
    Vector4

    The Vector4 read from the stream.

    ReadVector4Packed()

    Read a Vector4 from the stream.

    Declaration
    public Vector4 ReadVector4Packed()
    Returns
    Type Description
    Vector4

    The Vector4 read from the stream.

    SetStream(Stream)

    Changes the underlying stream the reader is reading from

    Declaration
    public void SetStream(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream to read from

    SkipPadBits()

    Skips pad bits and aligns the position to the next byte

    Declaration
    public void SkipPadBits()
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)