Append
Appends UTF-8 text to a buffer.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
Append(byte*, ushort, ushort, byte*, ushort)
Appends UTF-8 text to a buffer.
public static CopyError Append(byte* dest, ref ushort destLength, ushort destUTF8MaxLengthInBytes, byte* src, ushort srcLength)
Parameters
The destination buffer.
Reference to the destination buffer's length in bytes "before" the append. Will be assigned the number of bytes appended.
The destination buffer's length in bytes. Data will not be appended past this length.
The source buffer.
The number of bytes to read from the source.
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the append fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UTF-8.
Append(byte*, ushort, ushort, char*, int)
Appends UCS-2 text to a buffer, encoded as UTF-8.
public static CopyError Append(byte* dest, ref ushort destLength, ushort destUTF8MaxLengthInBytes, char* src, int srcLength)
Parameters
The destination buffer.
Reference to the destination buffer's length in bytes "before" the append. Will be assigned the number of bytes appended.
The destination buffer's length in bytes. Data will not be appended past this length.
The source buffer.
The number of chars to read from the source.
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the append fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UCS-2.
Append(char*, ushort, ushort, byte*, ushort)
Appends UTF-8 text to a buffer, encoded as UCS-2.
public static CopyError Append(char* dest, ref ushort destLength, ushort destUCS2MaxLengthInChars, byte* src, ushort srcLength)
Parameters
The destination buffer.
Reference to the destination buffer's length in chars "before" the append. Will be assigned the number of chars appended.
The destination buffer's length in chars. Data will not be appended past this length.
The source buffer.
The number of bytes to read from the source.
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the append fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UTF-8.