{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct UnsafeAppendBuffer | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct UnsafeAppendBuffer

    An unmanaged, untyped, heterogeneous buffer.

    Implements
    INativeDisposable
    Namespace: Unity.Collections.LowLevel.Unsafe
    Assembly: solution.dll
    Syntax
    public struct UnsafeAppendBuffer : INativeDisposable
    Remarks

    The values written to an individual append buffer can be of different types.

    Constructors

    Name Description
    UnsafeAppendBuffer(int, int, AllocatorHandle)

    Initializes and returns an instance of UnsafeAppendBuffer.

    UnsafeAppendBuffer(void*, int)

    Initializes and returns an instance of UnsafeAppendBuffer that aliases an existing buffer.

    Fields

    Name Description
    Alignment

    The byte alignment used when allocating the internal buffer.

    Allocator

    The allocator used to create the internal buffer.

    Capacity

    The size in bytes of the internal buffer.

    Length

    The size in bytes of the currently-used portion of the internal buffer.

    Ptr

    The internal buffer where the content is stored.

    Properties

    Name Description
    IsCreated

    Whether this append buffer has been allocated (and not yet deallocated).

    IsEmpty

    Whether the append buffer is empty.

    Methods

    Name Description
    Add(void*, int)

    Appends an element to the end of this append buffer.

    AddArray<T>(void*, int)

    Appends the elements of a buffer to the end of this append buffer.

    Add<T>(NativeArray<T>)

    Appends all elements of an array to the end of this append buffer.

    Add<T>(T)

    Appends an element to the end of this append buffer.

    AsReader()

    Returns a reader for this append buffer.

    Dispose()

    Releases all resources (memory and safety handles).

    Dispose(JobHandle)

    Creates and schedules a job that will dispose this append buffer.

    Pop(void*, int)

    Removes and copies the last element of this append buffer.

    Pop<T>()

    Removes and returns the last element of this append buffer.

    Reset()

    Sets the length to 0.

    ResizeUninitialized(int)

    Sets the length in bytes.

    SetCapacity(int)

    Sets the size in bytes of the internal buffer.

    Extension Methods

    Extensions.AddNBC(ref UnsafeAppendBuffer, string)
    Extensions.ToBytesNBC(ref UnsafeAppendBuffer)
    In This Article
    Back to top
    Copyright © 2023 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)