Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

dest

The destination buffer.

destLength

Reference to the destination buffer's length in bytes "before" the append. Will be assigned the number of bytes appended.

destUTF8MaxLengthInBytes

The destination buffer's length in bytes. Data will not be appended past this length.

The source buffer.

srcLength

The number of bytes to read from the source.

Returns

Type

Description

CopyErrorCopyError.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

dest

The destination buffer.

destLength

Reference to the destination buffer's length in bytes "before" the append. Will be assigned the number of bytes appended.

destUTF8MaxLengthInBytes

The destination buffer's length in bytes. Data will not be appended past this length.

The source buffer.

srcLength

The number of chars to read from the source.

Returns

Type

Description

CopyErrorCopyError.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

dest

The destination buffer.

destLength

Reference to the destination buffer's length in chars "before" the append. Will be assigned the number of chars appended.

destUCS2MaxLengthInChars

The destination buffer's length in chars. Data will not be appended past this length.

The source buffer.

srcLength

The number of bytes to read from the source.

Returns

Type

Description

CopyErrorCopyError.None if the append fully completes. Otherwise, returns CopyError.Truncation.

Remarks

Assumes the source data is valid UTF-8.