docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct FastBufferReader

    Optimized class used for reading values from a byte stream FastBufferWriter BytePacker ByteUnpacker

    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Netcode
    Assembly: Unity.Netcode.Runtime.dll
    Syntax
    public struct FastBufferReader : IDisposable

    Constructors

    FastBufferReader(ArraySegment<byte>, Allocator)

    Create a FastBufferReader from an ArraySegment that uses the ArraySegment.Offset for the reader's offset and the ArraySegment.Count for the reader's length.

    A new buffer will be created using the given allocator and the value will be copied in. FastBufferReader will then own the data.

    Allocator.None is not supported for byte[]. If you need this functionality, use a fixed() block and ensure the FastBufferReader isn't used outside that block.

    Declaration
    public FastBufferReader(ArraySegment<byte> buffer, Allocator copyAllocator)
    Parameters
    Type Name Description
    ArraySegment<byte> buffer

    The buffer to copy from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    FastBufferReader(ArraySegment<byte>, Allocator, int)

    Create a FastBufferReader from an ArraySegment that uses the ArraySegment.Offset for the reader's offset.

    A new buffer will be created using the given allocator and the value will be copied in. FastBufferReader will then own the data.

    Allocator.None is not supported for byte[]. If you need this functionality, use a fixed() block and ensure the FastBufferReader isn't used outside that block.

    Declaration
    public FastBufferReader(ArraySegment<byte> buffer, Allocator copyAllocator, int length = -1)
    Parameters
    Type Name Description
    ArraySegment<byte> buffer

    The buffer to copy from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    int length

    The number of bytes to copy (all if this is -1)

    FastBufferReader(ArraySegment<byte>, Allocator, int, int)

    Create a FastBufferReader from an ArraySegment.

    A new buffer will be created using the given allocator and the value will be copied in. FastBufferReader will then own the data.

    Allocator.None is not supported for byte[]. If you need this functionality, use a fixed() block and ensure the FastBufferReader isn't used outside that block.

    Declaration
    public FastBufferReader(ArraySegment<byte> buffer, Allocator copyAllocator, int length = -1, int offset = 0)
    Parameters
    Type Name Description
    ArraySegment<byte> buffer

    The buffer to copy from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    int length

    The number of bytes to copy (all if this is -1)

    int offset

    The offset of the buffer to start copying from

    FastBufferReader(byte*, Allocator, int, int, Allocator)

    Create a FastBufferReader from an existing byte buffer.

    A new buffer will be created using the given specified allocator and the value will be copied in. FastBufferReader will then own the data.

    The exception to this is when the specified allocator passed in is Allocator.None. In this scenario, ownership of the data remains with the caller and the reader will point at it directly. When created with Allocator.None, FastBufferReader will allocate some internal data using Allocator.Temp, so it should be treated as if it's a ref struct and not allowed to outlive the context in which it was created (it should neither be returned from that function nor stored anywhere in heap memory). This is true, unless the internal allocator param is explicitly set to i.e.: Allocator.Persistent in which case it would allow the internal data to Persist for longer, but the caller should manually call Dispose() when it is no longer needed.

    Declaration
    public FastBufferReader(byte* buffer, Allocator copyAllocator, int length, int offset = 0, Allocator internalAllocator = Allocator.Temp)
    Parameters
    Type Name Description
    byte* buffer

    The buffer to copy from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    int length

    The number of bytes to copy

    int offset

    The offset of the buffer to start copying from

    Allocator internalAllocator

    The allocator type used for internal data when this reader points directly at a buffer owned by someone else

    FastBufferReader(byte[], Allocator, int, int)

    Create a FastBufferReader from an existing byte array.

    A new buffer will be created using the given allocator and the value will be copied in. FastBufferReader will then own the data.

    Allocator.None is not supported for byte[]. If you need this functionality, use a fixed() block and ensure the FastBufferReader isn't used outside that block.

    Declaration
    public FastBufferReader(byte[] buffer, Allocator copyAllocator, int length = -1, int offset = 0)
    Parameters
    Type Name Description
    byte[] buffer

    The buffer to copy from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    int length

    The number of bytes to copy (all if this is -1)

    int offset

    The offset of the buffer to start copying from

    FastBufferReader(NativeArray<byte>, Allocator, int, int, Allocator)

    Create a FastBufferReader from a NativeArray.

    A new buffer will be created using the specified allocator and the value will be copied in. FastBufferReader will then own the data.

    The exception to this is when the allocator passed in is Allocator.None. In this scenario, ownership of the data remains with the caller and the reader will point at it directly. When created with Allocator.None, FastBufferReader will allocate some internal data using Allocator.Temp so it should be treated as if it's a ref struct and not allowed to outlive the context in which it was created (it should neither be returned from that function nor stored anywhere in heap memory). This is true, unless the internal allocator param is explicitly set to i.e.: Allocator.Persistent in which case it would allow the internal data to Persist for longer, but the caller should manually call Dispose() when it is no longer needed.

    Declaration
    public FastBufferReader(NativeArray<byte> buffer, Allocator copyAllocator, int length = -1, int offset = 0, Allocator internalAllocator = Allocator.Temp)
    Parameters
    Type Name Description
    NativeArray<byte> buffer

    The NativeArray to create the reader from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    int length

    The number of bytes to read from the buffer. If set to -1, the entire buffer length will be used

    int offset

    The offset into the buffer to start reading from

    Allocator internalAllocator

    The allocator type used for internal data when this reader points directly at a buffer owned by someone else

    FastBufferReader(FastBufferReader, Allocator, int, int, Allocator)

    Create a FastBufferReader from another existing FastBufferReader. This is typically used when you want to change the copyAllocator that a reader is allocated to - for example, upgrading a Temp reader to a Persistent one to be processed later.

    A new buffer will be created using the given specified allocator and the value will be copied in. FastBufferReader will then own the data.

    The exception to this is when the specified allocator passed in is Allocator.None. In this scenario, ownership of the data remains with the caller and the reader will point at it directly. When created with Allocator.None, FastBufferReader will allocate some internal data using Allocator.Temp, so it should be treated as if it's a ref struct and not allowed to outlive the context in which it was created (it should neither be returned from that function nor stored anywhere in heap memory).

    Declaration
    public FastBufferReader(FastBufferReader reader, Allocator copyAllocator, int length = -1, int offset = 0, Allocator internalAllocator = Allocator.Temp)
    Parameters
    Type Name Description
    FastBufferReader reader

    The reader to copy from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    int length

    The number of bytes to copy (all if this is -1)

    int offset

    The offset of the buffer to start copying from

    Allocator internalAllocator

    The allocator type used for internal data when this reader points directly at a buffer owned by someone else

    FastBufferReader(FastBufferWriter, Allocator, int, int, Allocator)

    Create a FastBufferReader from a FastBufferWriter.

    A new buffer will be created using the given specified allocator and the value will be copied in. FastBufferReader will then own the data.

    The exception to this is when the specified allocator passed in is Allocator.None. In this scenario, ownership of the data remains with the caller and the reader will point at it directly. When created with Allocator.None, FastBufferReader will allocate some internal data using Allocator.Temp, so it should be treated as if it's a ref struct and not allowed to outlive the context in which it was created (it should neither be returned from that function nor stored anywhere in heap memory). This is true, unless the internal Allocator param is explicitly set to i.e.: Allocator.Persistent in which case it would allow the internal data to Persist for longer, but the caller should manually call Dispose() when it is no longer needed.

    Declaration
    public FastBufferReader(FastBufferWriter writer, Allocator copyAllocator, int length = -1, int offset = 0, Allocator internalAllocator = Allocator.Temp)
    Parameters
    Type Name Description
    FastBufferWriter writer

    The writer to copy from

    Allocator copyAllocator

    The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance

    int length

    The number of bytes to copy (all if this is -1)

    int offset

    The offset of the buffer to start copying from

    Allocator internalAllocator

    The allocator type used for internal data when this reader points directly at a buffer owned by someone else

    Properties

    IsInitialized

    Gets a value indicating whether the reader has been initialized and a handle allocated.

    Declaration
    public bool IsInitialized { get; }
    Property Value
    Type Description
    bool

    Length

    Get the total length of the buffer

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    int

    Position

    Get the current read position

    Declaration
    public int Position { get; }
    Property Value
    Type Description
    int

    Methods

    Dispose()

    IDisposable implementation that frees the allocated buffer

    Declaration
    public void Dispose()

    EnterBitwiseContext()

    Retrieve a BitReader to be able to perform bitwise operations on the buffer. No bytewise operations can be performed on the buffer until bitReader.Dispose() has been called. At the end of the operation, FastBufferReader will remain byte-aligned.

    Declaration
    public BitReader EnterBitwiseContext()
    Returns
    Type Description
    BitReader

    A BitReader

    GetUnsafePtr()

    Gets a direct pointer to the underlying buffer

    Declaration
    public byte* GetUnsafePtr()
    Returns
    Type Description
    byte*

    byte pointer

    GetUnsafePtrAtCurrentPosition()

    Gets a direct pointer to the underlying buffer at the current read position

    Declaration
    public byte* GetUnsafePtrAtCurrentPosition()
    Returns
    Type Description
    byte*

    byte pointer

    ReadByte(out byte)

    Read a byte to the stream.

    Declaration
    public void ReadByte(out byte value)
    Parameters
    Type Name Description
    byte value

    Stores the read value

    ReadByteSafe(out byte)

    Read a byte to the stream.

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadByteSafe(out byte value)
    Parameters
    Type Name Description
    byte value

    Stores the read value

    ReadBytes(byte*, int, int)

    Read multiple bytes to the stream

    Declaration
    public void ReadBytes(byte* value, int size, int offset = 0)
    Parameters
    Type Name Description
    byte* value

    Pointer to the destination buffer

    int size

    Number of bytes to read - MUST BE <= BUFFER SIZE

    int offset

    Offset of the byte buffer to store into

    ReadBytes(ref byte[], int, int)

    Read multiple bytes from the stream

    Declaration
    public void ReadBytes(ref byte[] value, int size, int offset = 0)
    Parameters
    Type Name Description
    byte[] value

    Pointer to the destination buffer

    int size

    Number of bytes to read - MUST BE <= BUFFER SIZE

    int offset

    Offset of the byte buffer to store into

    ReadBytesSafe(byte*, int, int)

    Read multiple bytes to the stream

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadBytesSafe(byte* value, int size, int offset = 0)
    Parameters
    Type Name Description
    byte* value

    Pointer to the destination buffer

    int size

    Number of bytes to read - MUST BE <= BUFFER SIZE

    int offset

    Offset of the byte buffer to store into

    ReadBytesSafe(ref byte[], int, int)

    Read multiple bytes from the stream

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadBytesSafe(ref byte[] value, int size, int offset = 0)
    Parameters
    Type Name Description
    byte[] value

    Pointer to the destination buffer

    int size

    Number of bytes to read - MUST BE <= BUFFER SIZE

    int offset

    Offset of the byte buffer to store into

    ReadNetworkSerializableInPlace<T>(ref T)

    Read an INetworkSerializable in-place, without constructing a new one Note that this will NOT check for null before calling NetworkSerialize

    Declaration
    public void ReadNetworkSerializableInPlace<T>(ref T value) where T : INetworkSerializable
    Parameters
    Type Name Description
    T value

    INetworkSerializable instance

    Type Parameters
    Name Description
    T

    The type that implements INetworkSerializable and can be deserialized

    Exceptions
    Type Condition
    NotImplementedException

    hrown if the type T does not properly implement NetworkSerialize

    ReadNetworkSerializable<T>(out NativeArray<T>, Allocator)

    Read a NativeArray of INetworkSerializables

    Declaration
    public void ReadNetworkSerializable<T>(out NativeArray<T> value, Allocator allocator) where T : unmanaged, INetworkSerializable
    Parameters
    Type Name Description
    NativeArray<T> value

    INetworkSerializable instance

    Allocator allocator

    The allocator to use to construct the resulting NativeArray

    Type Parameters
    Name Description
    T

    the array to read the values of type T from

    Exceptions
    Type Condition
    NotImplementedException

    Thrown if the type T does not properly implement NetworkSerialize

    ReadNetworkSerializable<T>(out T)

    Read an INetworkSerializable

    Declaration
    public void ReadNetworkSerializable<T>(out T value) where T : INetworkSerializable, new()
    Parameters
    Type Name Description
    T value

    INetworkSerializable instance

    Type Parameters
    Name Description
    T

    The type that implements INetworkSerializable and can be deserialized

    Exceptions
    Type Condition
    NotImplementedException

    Thrown if the type T does not properly implement NetworkSerialize

    ReadNetworkSerializable<T>(out T[])

    Read an array of INetworkSerializables

    Declaration
    public void ReadNetworkSerializable<T>(out T[] value) where T : INetworkSerializable, new()
    Parameters
    Type Name Description
    T[] value

    INetworkSerializable instance

    Type Parameters
    Name Description
    T

    the array to read the values of type T from

    Exceptions
    Type Condition
    NotImplementedException

    Thrown if the type T does not properly implement NetworkSerialize

    ReadPartialValue<T>(out T, int, int)

    Read a partial value. The value is zero-initialized and then the specified number of bytes is read into it.

    Declaration
    public void ReadPartialValue<T>(out T value, int bytesToRead, int offsetBytes = 0) where T : unmanaged
    Parameters
    Type Name Description
    T value

    Value to read

    int bytesToRead

    The number of bytes to read from the buffer into the value

    int offsetBytes

    The offset in bytes from the start of the value where the read bytes will be written

    Type Parameters
    Name Description
    T

    The unmanaged type to read into. Must be unmanaged to allow direct memory access

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when attempting to use BufferReader in bytewise mode while in a bitwise context

    OverflowException

    Thrown when attempting to read without first calling TryBeginRead() or when reading beyond the allowed read mark

    ReadValue(out string, bool)

    Reads a string NOTE: ALLOCATES

    Declaration
    public void ReadValue(out string s, bool oneByteChars = false)
    Parameters
    Type Name Description
    string s

    Stores the read string

    bool oneByteChars

    Whether or not to use one byte per character. This will only allow ASCII

    ReadValue(out Color32)

    Read a Color32

    Declaration
    public void ReadValue(out Color32 value)
    Parameters
    Type Name Description
    Color32 value

    the value to read

    ReadValue(out Color32[])

    Read a Color32 array

    Declaration
    public void ReadValue(out Color32[] value)
    Parameters
    Type Name Description
    Color32[] value

    the values to read

    ReadValue(out Color)

    Read a Color

    Declaration
    public void ReadValue(out Color value)
    Parameters
    Type Name Description
    Color value

    the value to read

    ReadValue(out Color[])

    Read a Color array

    Declaration
    public void ReadValue(out Color[] value)
    Parameters
    Type Name Description
    Color[] value

    the values to read

    ReadValue(out Quaternion)

    Read a Quaternion

    Declaration
    public void ReadValue(out Quaternion value)
    Parameters
    Type Name Description
    Quaternion value

    the value to read

    ReadValue(out Quaternion[])

    Read a Quaternion array

    Declaration
    public void ReadValue(out Quaternion[] value)
    Parameters
    Type Name Description
    Quaternion[] value

    the values to read

    ReadValue(out Ray2D)

    Read a Ray2D

    Declaration
    public void ReadValue(out Ray2D value)
    Parameters
    Type Name Description
    Ray2D value

    the value to read

    ReadValue(out Ray2D[])

    Read a Ray2D array

    Declaration
    public void ReadValue(out Ray2D[] value)
    Parameters
    Type Name Description
    Ray2D[] value

    the values to read

    ReadValue(out Ray)

    Read a Ray

    Declaration
    public void ReadValue(out Ray value)
    Parameters
    Type Name Description
    Ray value

    the value to read

    ReadValue(out Ray[])

    Read a Ray array

    Declaration
    public void ReadValue(out Ray[] value)
    Parameters
    Type Name Description
    Ray[] value

    the values to read

    ReadValue(out Vector2)

    Read a Vector2

    Declaration
    public void ReadValue(out Vector2 value)
    Parameters
    Type Name Description
    Vector2 value

    the value to read

    ReadValue(out Vector2Int)

    Read a Vector2Int

    Declaration
    public void ReadValue(out Vector2Int value)
    Parameters
    Type Name Description
    Vector2Int value

    the value to read

    ReadValue(out Vector2Int[])

    Read a Vector2Int array

    Declaration
    public void ReadValue(out Vector2Int[] value)
    Parameters
    Type Name Description
    Vector2Int[] value

    the values to read

    ReadValue(out Vector2[])

    Read a Vector2 array

    Declaration
    public void ReadValue(out Vector2[] value)
    Parameters
    Type Name Description
    Vector2[] value

    the values to read

    ReadValue(out Vector3)

    Read a Vector3

    Declaration
    public void ReadValue(out Vector3 value)
    Parameters
    Type Name Description
    Vector3 value

    the value to read

    ReadValue(out Vector3Int)

    Read a Vector3Int

    Declaration
    public void ReadValue(out Vector3Int value)
    Parameters
    Type Name Description
    Vector3Int value

    the value to read

    ReadValue(out Vector3Int[])

    Read a Vector3Int array

    Declaration
    public void ReadValue(out Vector3Int[] value)
    Parameters
    Type Name Description
    Vector3Int[] value

    the value to read

    ReadValue(out Vector3[])

    Read a Vector3 array

    Declaration
    public void ReadValue(out Vector3[] value)
    Parameters
    Type Name Description
    Vector3[] value

    the values to read

    ReadValue(out Vector4)

    Read a Vector4

    Declaration
    public void ReadValue(out Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

    the value to read

    ReadValue(out Vector4[])

    Read a Vector4

    Declaration
    public void ReadValue(out Vector4[] value)
    Parameters
    Type Name Description
    Vector4[] value

    the values to read

    ReadValueSafe(out string, bool)

    Reads a string. NOTE: ALLOCATES

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out string s, bool oneByteChars = false)
    Parameters
    Type Name Description
    string s

    Stores the read string

    bool oneByteChars

    Whether or not to use one byte per character. This will only allow ASCII

    ReadValueSafe(out Color32)

    Read a Color32

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Color32 value)
    Parameters
    Type Name Description
    Color32 value

    the value to read

    ReadValueSafe(out Color32[])

    Read a Color32 array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Color32[] value)
    Parameters
    Type Name Description
    Color32[] value

    the values to read

    ReadValueSafe(out Color)

    Read a Color

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Color value)
    Parameters
    Type Name Description
    Color value

    the value to read

    ReadValueSafe(out Color[])

    Read a Collor array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Color[] value)
    Parameters
    Type Name Description
    Color[] value

    the values to read

    ReadValueSafe(out Quaternion)

    Read a Quaternion

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Quaternion value)
    Parameters
    Type Name Description
    Quaternion value

    the value to read

    ReadValueSafe(out Quaternion[])

    Read a Quaternion array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Quaternion[] value)
    Parameters
    Type Name Description
    Quaternion[] value

    the values to read

    ReadValueSafe(out Ray2D)

    Read a Ray2D

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Ray2D value)
    Parameters
    Type Name Description
    Ray2D value

    the value to read

    ReadValueSafe(out Ray2D[])

    Read a Ray2D array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Ray2D[] value)
    Parameters
    Type Name Description
    Ray2D[] value

    the values to read

    ReadValueSafe(out Ray)

    Read a Ray

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Ray value)
    Parameters
    Type Name Description
    Ray value

    the value to read

    ReadValueSafe(out Ray[])

    Read a Ray array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Ray[] value)
    Parameters
    Type Name Description
    Ray[] value

    the values to read

    ReadValueSafe(out Vector2)

    Read a Vector2

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector2 value)
    Parameters
    Type Name Description
    Vector2 value

    the value to read

    ReadValueSafe(out Vector2Int)

    Read a Vector2Int

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector2Int value)
    Parameters
    Type Name Description
    Vector2Int value

    the value to read

    ReadValueSafe(out Vector2Int[])

    Read a Vector2Int array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector2Int[] value)
    Parameters
    Type Name Description
    Vector2Int[] value

    the values to read

    ReadValueSafe(out Vector2[])

    Read a Vector2 array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector2[] value)
    Parameters
    Type Name Description
    Vector2[] value

    the values to read

    ReadValueSafe(out Vector3)

    Read a Vector3

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector3 value)
    Parameters
    Type Name Description
    Vector3 value

    the value to read

    ReadValueSafe(out Vector3Int)

    Read a Vector3Int

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector3Int value)
    Parameters
    Type Name Description
    Vector3Int value

    the value to read

    ReadValueSafe(out Vector3Int[])

    Read a Vector3Int array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector3Int[] value)
    Parameters
    Type Name Description
    Vector3Int[] value

    the values to read

    ReadValueSafe(out Vector3[])

    Read a Vector3 array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector3[] value)
    Parameters
    Type Name Description
    Vector3[] value

    the values to read

    ReadValueSafe(out Vector4)

    Read a Vector4

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

    the value to read

    ReadValueSafe(out Vector4[])

    Read a Vector4 array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe(out Vector4[] value)
    Parameters
    Type Name Description
    Vector4[] value

    the values to read

    ReadValueSafeInPlace<T>(ref T, ForFixedStrings)

    Read a FixedString value.

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafeInPlace<T>(ref T value, FastBufferWriter.ForFixedStrings unused = default) where T : unmanaged, INativeList<byte>, IUTF8Bytes
    Parameters
    Type Name Description
    T value

    the value to read

    FastBufferWriter.ForFixedStrings unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafeTemp<T>(out NativeArray<T>)

    Read a FixedString NativeArray using a Temp allocator. Equivalent to ReadValueSafe(out value, Allocator.Temp)

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafeTemp<T>(out NativeArray<T> value) where T : unmanaged, INativeList<byte>, IUTF8Bytes
    Parameters
    Type Name Description
    NativeArray<T> value

    the value to read

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafeTemp<T>(out NativeArray<T>, ForGeneric)

    Read a struct NativeArray using a Temp allocator. Equivalent to ReadValueSafe(out value, Allocator.Temp)

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafeTemp<T>(out NativeArray<T> value, FastBufferWriter.ForGeneric unused = default) where T : unmanaged
    Parameters
    Type Name Description
    NativeArray<T> value

    The values to read

    FastBufferWriter.ForGeneric unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out NativeArray<T>, Allocator)

    Read a FixedString NativeArray.

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out NativeArray<T> value, Allocator allocator) where T : unmanaged, INativeList<byte>, IUTF8Bytes
    Parameters
    Type Name Description
    NativeArray<T> value

    the value to read

    Allocator allocator

    The allocator to use to construct the resulting NativeArray

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out NativeArray<T>, Allocator, ForGeneric)

    Read a struct NativeArray

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out NativeArray<T> value, Allocator allocator, FastBufferWriter.ForGeneric unused = default) where T : unmanaged
    Parameters
    Type Name Description
    NativeArray<T> value

    The values to read

    Allocator allocator

    The allocator to use to construct the resulting NativeArray

    FastBufferWriter.ForGeneric unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out NativeArray<T>, Allocator, ForNetworkSerializable)

    Read a NetworkSerializable NativeArray

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out NativeArray<T> value, Allocator allocator, FastBufferWriter.ForNetworkSerializable unused = default) where T : unmanaged, INetworkSerializable
    Parameters
    Type Name Description
    NativeArray<T> value

    The values to read

    Allocator allocator

    The allocator to use to construct the resulting NativeArray

    FastBufferWriter.ForNetworkSerializable unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T, ForEnums)

    Read an enum value

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForEnums unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T, ForFixedStrings)

    Read a FixedString value.

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T value, FastBufferWriter.ForFixedStrings unused = default) where T : unmanaged, INativeList<byte>, IUTF8Bytes
    Parameters
    Type Name Description
    T value

    the value to read

    FastBufferWriter.ForFixedStrings unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T, ForNetworkSerializable)

    Read a NetworkSerializable value

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new()
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForNetworkSerializable unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T, ForPrimitives)

    Read a primitive value (int, bool, etc) Accepts any value that implements the given interfaces, but is not guaranteed to work correctly on values that are not primitives.

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable<T>, IEquatable<T>
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForPrimitives unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T, ForStructs)

    Read a struct

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForStructs unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T[], ForEnums)

    Read an enum array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T[] value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum
    Parameters
    Type Name Description
    T[] value

    The values to read

    FastBufferWriter.ForEnums unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T[], ForFixedStrings)

    Read a FixedString NativeArray using a Temp allocator. Equivalent to ReadValueSafe(out value, Allocator.Temp)

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T[] value, FastBufferWriter.ForFixedStrings unused = default) where T : unmanaged, INativeList<byte>, IUTF8Bytes
    Parameters
    Type Name Description
    T[] value

    the value to read

    FastBufferWriter.ForFixedStrings unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T[], ForNetworkSerializable)

    Read a NetworkSerializable array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T[] value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new()
    Parameters
    Type Name Description
    T[] value

    The values to read

    FastBufferWriter.ForNetworkSerializable unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T[], ForPrimitives)

    Read a primitive value (int, bool, etc) array Accepts any value that implements the given interfaces, but is not guaranteed to work correctly on values that are not primitives.

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T[] value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable<T>, IEquatable<T>
    Parameters
    Type Name Description
    T[] value

    The value to read

    FastBufferWriter.ForPrimitives unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueSafe<T>(out T[], ForStructs)

    Read a struct array

    "Safe" version - automatically performs bounds checking. Less efficient than bounds checking for multiple reads at once by calling TryBeginRead.

    Declaration
    public void ReadValueSafe<T>(out T[] value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy
    Parameters
    Type Name Description
    T[] value

    The values to read

    FastBufferWriter.ForStructs unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValueTemp<T>(out NativeArray<T>, ForGeneric)

    Read a struct NativeArray using a Temp allocator. Equivalent to ReadValue(out value, Allocator.Temp)

    Declaration
    public void ReadValueTemp<T>(out NativeArray<T> value, FastBufferWriter.ForGeneric unused = default) where T : unmanaged
    Parameters
    Type Name Description
    NativeArray<T> value

    The values to read

    FastBufferWriter.ForGeneric unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out NativeArray<T>, Allocator, ForGeneric)

    Read a struct NativeArray

    Declaration
    public void ReadValue<T>(out NativeArray<T> value, Allocator allocator, FastBufferWriter.ForGeneric unused = default) where T : unmanaged
    Parameters
    Type Name Description
    NativeArray<T> value

    The values to read

    Allocator allocator

    The allocator to use to construct the resulting NativeArray

    FastBufferWriter.ForGeneric unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T, ForEnums)

    Read an enum value

    Declaration
    public void ReadValue<T>(out T value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForEnums unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T, ForFixedStrings)

    Read a FixedString value. This method is a little difficult to use, since you have to know the size of the string before reading it, but is useful when the string is a known, fixed size. Note that the size of the string is also encoded, so the size to call TryBeginRead on is actually the fixed size (in bytes) plus sizeof(uint)

    Declaration
    public void ReadValue<T>(out T value, FastBufferWriter.ForFixedStrings unused = default) where T : unmanaged, INativeList<byte>, IUTF8Bytes
    Parameters
    Type Name Description
    T value

    the value to read

    FastBufferWriter.ForFixedStrings unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T, ForNetworkSerializable)

    Read a NetworkSerializable value

    Declaration
    public void ReadValue<T>(out T value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new()
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForNetworkSerializable unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T, ForPrimitives)

    Read a primitive value (int, bool, etc) Accepts any value that implements the given interfaces, but is not guaranteed to work correctly on values that are not primitives.

    Declaration
    public void ReadValue<T>(out T value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable<T>, IEquatable<T>
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForPrimitives unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T, ForStructs)

    Read a struct

    Declaration
    public void ReadValue<T>(out T value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy
    Parameters
    Type Name Description
    T value

    The value to read

    FastBufferWriter.ForStructs unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T[], ForEnums)

    Read an enum array

    Declaration
    public void ReadValue<T>(out T[] value, FastBufferWriter.ForEnums unused = default) where T : unmanaged, Enum
    Parameters
    Type Name Description
    T[] value

    The values to read

    FastBufferWriter.ForEnums unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T[], ForNetworkSerializable)

    Read a NetworkSerializable array

    Declaration
    public void ReadValue<T>(out T[] value, FastBufferWriter.ForNetworkSerializable unused = default) where T : INetworkSerializable, new()
    Parameters
    Type Name Description
    T[] value

    The values to read

    FastBufferWriter.ForNetworkSerializable unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T[], ForPrimitives)

    Read a primitive value array (int, bool, etc) Accepts any value that implements the given interfaces, but is not guaranteed to work correctly on values that are not primitives.

    Declaration
    public void ReadValue<T>(out T[] value, FastBufferWriter.ForPrimitives unused = default) where T : unmanaged, IComparable, IConvertible, IComparable<T>, IEquatable<T>
    Parameters
    Type Name Description
    T[] value

    The values to read

    FastBufferWriter.ForPrimitives unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    ReadValue<T>(out T[], ForStructs)

    Read a struct array

    Declaration
    public void ReadValue<T>(out T[] value, FastBufferWriter.ForStructs unused = default) where T : unmanaged, INetworkSerializeByMemcpy
    Parameters
    Type Name Description
    T[] value

    The values to read

    FastBufferWriter.ForStructs unused

    An unused parameter used for enabling overload resolution based on generic constraints

    Type Parameters
    Name Description
    T

    The type being serialized

    Seek(int)

    Move the read position in the stream

    Declaration
    public void Seek(int where)
    Parameters
    Type Name Description
    int where

    Absolute value to move the position to, truncated to Length

    ToArray()

    Returns an array representation of the underlying byte buffer. !!Allocates a new array!!

    Declaration
    public byte[] ToArray()
    Returns
    Type Description
    byte[]

    byte array

    TryBeginRead(int)

    Allows faster serialization by batching bounds checking. When you know you will be reading multiple fields back-to-back and you know the total size, you can call TryBeginRead() once on the total size, and then follow it with calls to ReadValue() instead of ReadValueSafe() for faster serialization.

    Unsafe read operations will throw OverflowException in editor and development builds if you go past the point you've marked using TryBeginRead(). In release builds, OverflowException will not be thrown for performance reasons, since the point of using TryBeginRead is to avoid bounds checking in the following operations in release builds.

    Declaration
    public bool TryBeginRead(int bytes)
    Parameters
    Type Name Description
    int bytes

    Amount of bytes to read

    Returns
    Type Description
    bool

    True if the read is allowed, false otherwise

    Exceptions
    Type Condition
    InvalidOperationException

    If called while in a bitwise context

    TryBeginReadValue<T>(in T)

    Allows faster serialization by batching bounds checking. When you know you will be reading multiple fields back-to-back and you know the total size, you can call TryBeginRead() once on the total size, and then follow it with calls to ReadValue() instead of ReadValueSafe() for faster serialization.

    Unsafe read operations will throw OverflowException in editor and development builds if you go past the point you've marked using TryBeginRead(). In release builds, OverflowException will not be thrown for performance reasons, since the point of using TryBeginRead is to avoid bounds checking in the following operations in release builds.

    Declaration
    public bool TryBeginReadValue<T>(in T value) where T : unmanaged
    Parameters
    Type Name Description
    T value

    The value you want to read

    Returns
    Type Description
    bool

    True if the read is allowed, false otherwise

    Type Parameters
    Name Description
    T

    the type T of the value you are trying to read

    Exceptions
    Type Condition
    InvalidOperationException

    If called while in a bitwise context

    Implements

    IDisposable

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    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.

    In This Article
    • Constructors
      • FastBufferReader(ArraySegment<byte>, Allocator)
      • FastBufferReader(ArraySegment<byte>, Allocator, int)
      • FastBufferReader(ArraySegment<byte>, Allocator, int, int)
      • FastBufferReader(byte*, Allocator, int, int, Allocator)
      • FastBufferReader(byte[], Allocator, int, int)
      • FastBufferReader(NativeArray<byte>, Allocator, int, int, Allocator)
      • FastBufferReader(FastBufferReader, Allocator, int, int, Allocator)
      • FastBufferReader(FastBufferWriter, Allocator, int, int, Allocator)
    • Properties
      • IsInitialized
      • Length
      • Position
    • Methods
      • Dispose()
      • EnterBitwiseContext()
      • GetUnsafePtr()
      • GetUnsafePtrAtCurrentPosition()
      • ReadByte(out byte)
      • ReadByteSafe(out byte)
      • ReadBytes(byte*, int, int)
      • ReadBytes(ref byte[], int, int)
      • ReadBytesSafe(byte*, int, int)
      • ReadBytesSafe(ref byte[], int, int)
      • ReadNetworkSerializableInPlace<T>(ref T)
      • ReadNetworkSerializable<T>(out NativeArray<T>, Allocator)
      • ReadNetworkSerializable<T>(out T)
      • ReadNetworkSerializable<T>(out T[])
      • ReadPartialValue<T>(out T, int, int)
      • ReadValue(out string, bool)
      • ReadValue(out Color32)
      • ReadValue(out Color32[])
      • ReadValue(out Color)
      • ReadValue(out Color[])
      • ReadValue(out Quaternion)
      • ReadValue(out Quaternion[])
      • ReadValue(out Ray2D)
      • ReadValue(out Ray2D[])
      • ReadValue(out Ray)
      • ReadValue(out Ray[])
      • ReadValue(out Vector2)
      • ReadValue(out Vector2Int)
      • ReadValue(out Vector2Int[])
      • ReadValue(out Vector2[])
      • ReadValue(out Vector3)
      • ReadValue(out Vector3Int)
      • ReadValue(out Vector3Int[])
      • ReadValue(out Vector3[])
      • ReadValue(out Vector4)
      • ReadValue(out Vector4[])
      • ReadValueSafe(out string, bool)
      • ReadValueSafe(out Color32)
      • ReadValueSafe(out Color32[])
      • ReadValueSafe(out Color)
      • ReadValueSafe(out Color[])
      • ReadValueSafe(out Quaternion)
      • ReadValueSafe(out Quaternion[])
      • ReadValueSafe(out Ray2D)
      • ReadValueSafe(out Ray2D[])
      • ReadValueSafe(out Ray)
      • ReadValueSafe(out Ray[])
      • ReadValueSafe(out Vector2)
      • ReadValueSafe(out Vector2Int)
      • ReadValueSafe(out Vector2Int[])
      • ReadValueSafe(out Vector2[])
      • ReadValueSafe(out Vector3)
      • ReadValueSafe(out Vector3Int)
      • ReadValueSafe(out Vector3Int[])
      • ReadValueSafe(out Vector3[])
      • ReadValueSafe(out Vector4)
      • ReadValueSafe(out Vector4[])
      • ReadValueSafeInPlace<T>(ref T, ForFixedStrings)
      • ReadValueSafeTemp<T>(out NativeArray<T>)
      • ReadValueSafeTemp<T>(out NativeArray<T>, ForGeneric)
      • ReadValueSafe<T>(out NativeArray<T>, Allocator)
      • ReadValueSafe<T>(out NativeArray<T>, Allocator, ForGeneric)
      • ReadValueSafe<T>(out NativeArray<T>, Allocator, ForNetworkSerializable)
      • ReadValueSafe<T>(out T, ForEnums)
      • ReadValueSafe<T>(out T, ForFixedStrings)
      • ReadValueSafe<T>(out T, ForNetworkSerializable)
      • ReadValueSafe<T>(out T, ForPrimitives)
      • ReadValueSafe<T>(out T, ForStructs)
      • ReadValueSafe<T>(out T[], ForEnums)
      • ReadValueSafe<T>(out T[], ForFixedStrings)
      • ReadValueSafe<T>(out T[], ForNetworkSerializable)
      • ReadValueSafe<T>(out T[], ForPrimitives)
      • ReadValueSafe<T>(out T[], ForStructs)
      • ReadValueTemp<T>(out NativeArray<T>, ForGeneric)
      • ReadValue<T>(out NativeArray<T>, Allocator, ForGeneric)
      • ReadValue<T>(out T, ForEnums)
      • ReadValue<T>(out T, ForFixedStrings)
      • ReadValue<T>(out T, ForNetworkSerializable)
      • ReadValue<T>(out T, ForPrimitives)
      • ReadValue<T>(out T, ForStructs)
      • ReadValue<T>(out T[], ForEnums)
      • ReadValue<T>(out T[], ForNetworkSerializable)
      • ReadValue<T>(out T[], ForPrimitives)
      • ReadValue<T>(out T[], ForStructs)
      • Seek(int)
      • ToArray()
      • TryBeginRead(int)
      • TryBeginReadValue<T>(in T)
    • Implements
    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)