docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method WriteBytesSafe

    WriteBytesSafe(byte*, int, int)

    Write multiple bytes to the stream

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

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

    Value to write

    int size

    Number of bytes to write

    int offset

    Offset into the buffer to begin writing

    WriteBytesSafe(byte[], int, int)

    Write multiple bytes to the stream

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

    Declaration
    public void WriteBytesSafe(byte[] value, int size = -1, int offset = 0)
    Parameters
    Type Name Description
    byte[] value

    Value to write

    int size

    Number of bytes to write

    int offset

    Offset into the buffer to begin writing

    WriteBytesSafe(NativeArray<byte>, int, int)

    Write multiple bytes to the stream

    Declaration
    public void WriteBytesSafe(NativeArray<byte> value, int size = -1, int offset = 0)
    Parameters
    Type Name Description
    NativeArray<byte> value

    Value to write

    int size

    Number of bytes to write

    int offset

    Offset into the buffer to begin writing

    WriteBytesSafe(NativeList<byte>, int, int)

    Write multiple bytes to the stream

    Declaration
    public void WriteBytesSafe(NativeList<byte> value, int size = -1, int offset = 0)
    Parameters
    Type Name Description
    NativeList<byte> value

    Value to write

    int size

    Number of bytes to write

    int offset

    Offset into the buffer to begin writing

    In This Article
    Back to top
    Copyright © 2024 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)