Struct JsonStringBuffer
Represents a writable string of characters.
Namespace: Unity.Serialization.Json
Syntax
public struct JsonStringBuffer : IDisposable
Constructors
JsonStringBuffer(Int32, Allocator)
Initializes a new instance of JsonStringBuffer.
Declaration
public JsonStringBuffer(int initialCapacity, Allocator label)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | 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
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*, Int32)
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. |
| Int32 | length | The number of characters to write. |
Write(Char, Int32)
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. |
| Int32 | repeatCount | The number of times to write |
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(Int32)
Writes the string representation of a specified 32-bit signed integer to the buffer.
Declaration
public void Write(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | value | The value to write. |
Write(Int64)
Writes the string representation of a specified 64-bit signed integer to the buffer.
Declaration
public void Write(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| Int64 | value | The value to write. |
Write(Single)
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 |
|---|---|---|
| Single | 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(UInt32)
Writes the string representation of a specified 32-bit unsigned integer to the buffer.
Declaration
public void Write(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | value | The value to write. |
Write(UInt64)
Writes the string representation of a specified 64-bit unsigned integer to the buffer.
Declaration
public void Write(ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt64 | 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. |