Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DecodeUtf8Prefixed()

static unsafe string System.Reflection.Internal.EncodingHelper.DecodeUtf8Prefixed ( byte * bytes,
int byteCount,
byte[] prefix,
MetadataStringDecoder utf8Decoder )
inlinestaticprivate

Definition at line 33 of file EncodingHelper.cs.

34 {
35 int num = byteCount + prefix.Length;
36 if (num == 0)
37 {
38 return string.Empty;
39 }
40 byte[] array = ArrayPool<byte>.Shared.Rent(num);
41 prefix.CopyTo(array, 0);
43 string @string;
44 fixed (byte* bytes2 = &array[0])
45 {
46 @string = utf8Decoder.GetString(bytes2, num);
47 }
49 return @string;
50 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
virtual unsafe string GetString(byte *bytes, int byteCount)
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
Definition Marshal.cs:800

References System.array, System.byteCount, System.bytes, System.Runtime.InteropServices.Marshal.Copy(), System.Reflection.Metadata.MetadataStringDecoder.GetString(), System.prefix, and System.Buffers.ArrayPool< T >.Shared.

Referenced by System.Reflection.Internal.EncodingHelper.DecodeUtf8().