docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct JsonStringBuffer

    Represents a writable string of characters.

    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Serialization.Json
    Assembly: Unity.Serialization.dll
    Syntax
    public struct JsonStringBuffer : IDisposable

    Constructors

    JsonStringBuffer(int, Allocator)

    Initializes a new instance of JsonStringBuffer.

    Declaration
    public JsonStringBuffer(int initialCapacity, Allocator label)
    Parameters
    Type Name Description
    int initialCapacity

    The initial capacity to use for the internal buffer.

    Allocator label

    The allocator label to use.

    Methods

    Dispose()

    Declaration
    public void Dispose()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    Write(char)

    Writes the string representation of a specified unicode character to the buffer.

    Declaration
    public void Write(char value)
    Parameters
    Type Name Description
    char value

    The value to write.

    Write(char*, int)

    Writes a copy of the specified string to the buffer.

    Declaration
    public void Write(char* buffer, int length)
    Parameters
    Type Name Description
    char* buffer

    A pointer to the string.

    int length

    The number of characters to write.

    Write(char, int)

    Writes a specified number of copies of the string representation of a unicode character to the buffer.

    Declaration
    public void Write(char value, int repeatCount)
    Parameters
    Type Name Description
    char value

    The value to write.

    int repeatCount

    The number of times to write value.

    Write(double)

    Writes the string representation of a specified 64-bit floating-point number to the buffer. This method will allocate.

    Declaration
    public void Write(double value)
    Parameters
    Type Name Description
    double value

    The value to write.

    Write(int)

    Writes the string representation of a specified 32-bit signed integer to the buffer.

    Declaration
    public void Write(int value)
    Parameters
    Type Name Description
    int value

    The value to write.

    Write(long)

    Writes the string representation of a specified 64-bit signed integer to the buffer.

    Declaration
    public void Write(long value)
    Parameters
    Type Name Description
    long value

    The value to write.

    Write(float)

    Writes the string representation of a specified 32-bit floating-point number to the buffer. This method will allocate.

    Declaration
    public void Write(float value)
    Parameters
    Type Name Description
    float value

    The value to write.

    Write(string)

    Writes a copy of the specified string to the buffer.

    Declaration
    public void Write(string value)
    Parameters
    Type Name Description
    string value

    The value to write.

    Write(uint)

    Writes the string representation of a specified 32-bit unsigned integer to the buffer.

    Declaration
    public void Write(uint value)
    Parameters
    Type Name Description
    uint value

    The value to write.

    Write(ulong)

    Writes the string representation of a specified 64-bit unsigned integer to the buffer.

    Declaration
    public void Write(ulong value)
    Parameters
    Type Name Description
    ulong value

    The value to write.

    WriteEncodedJsonString(char)

    Writes the specified unicode character to the buffer with surrounding quotes and escape characters.

    Declaration
    public void WriteEncodedJsonString(char value)
    Parameters
    Type Name Description
    char value

    The value to write.

    WriteEncodedJsonString(string)

    Writes a copy of the specified string to the buffer with surrounding quotes and escape characters.

    Declaration
    public void WriteEncodedJsonString(string value)
    Parameters
    Type Name Description
    string value

    The value to write.

    Implements

    IDisposable
    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)