Copy
Copies a buffer of UCS-2 text. The copy is encoded as UTF-8.
Read time 3 minutesLast updated 10 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
Copy(byte*, int, int, char*, int)
Copies a buffer of UCS-2 text. The copy is encoded as UTF-8.
public static CopyError Copy(byte* dest, out int destLength, int destUTF8MaxLengthInBytes, char* src, int srcLength)
Parameters
The destination buffer for writing UTF-8.
Outputs the number of bytes written to the destination.
The max number of bytes that will be written to the destination buffer.
The source buffer for reading UCS-2.
The number of chars to read from the source.
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the copy fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UCS-2.
Copy(byte*, ushort, ushort, char*, int)
Copies a buffer of UCS-2 text. The copy is encoded as UTF-8.
public static CopyError Copy(byte* dest, out ushort destLength, ushort destUTF8MaxLengthInBytes, char* src, int srcLength)
Parameters
The destination buffer for writing UTF-8.
Outputs the number of bytes written to the destination.
The max number of bytes that will be written to the destination buffer.
The source buffer for reading UCS-2.
The number of chars to read from the source.
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the copy fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UCS-2.
Copy(byte*, int, int, byte*, int)
Copies a buffer of UCS-8 text.
public static CopyError Copy(byte* dest, out int destLength, int destUTF8MaxLengthInBytes, byte* src, int srcLength)
Parameters
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the copy fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UTF-8.
Copy(byte*, ushort, ushort, byte*, ushort)
Copies a buffer of UCS-8 text.
public static CopyError Copy(byte* dest, out ushort destLength, ushort destUTF8MaxLengthInBytes, byte* src, ushort srcLength)
Parameters
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the copy fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UTF-8.
Copy(char*, int, int, byte*, int)
Copies a buffer of UTF-8 text. The copy is encoded as UCS-2.
public static CopyError Copy(char* dest, out int destLength, int destUCS2MaxLengthInChars, byte* src, int srcLength)
Parameters
The destination buffer for writing UCS-2.
Outputs the number of chars written to the destination.
The max number of chars that will be written to the destination buffer.
The source buffer for reading UTF-8.
The number of bytes to read from the source.
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the copy fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UTF-8.
Copy(char*, ushort, ushort, byte*, ushort)
Copies a buffer of UTF-8 text. The copy is encoded as UCS-2.
public static CopyError Copy(char* dest, out ushort destLength, ushort destUCS2MaxLengthInChars, byte* src, ushort srcLength)
Parameters
The destination buffer for writing UCS-2.
Outputs the number of chars written to the destination.
The max number of chars that will be written to the destination buffer.
The source buffer for reading UTF-8.
The number of bytes to read from the source.
Returns
Type | Description |
|---|---|
| CopyError | CopyError.None if the copy fully completes. Otherwise, returns CopyError.Truncation. |
Remarks
Assumes the source data is valid UTF-8.