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

◆ GetBytesForSmallInput()

unsafe byte[] System.Text.UTF8Encoding.UTF8EncodingSealed.GetBytesForSmallInput ( string s)
inlineprivate

Definition at line 47 of file UTF8Encoding.cs.

48 {
49 byte* ptr = stackalloc byte[96];
50 int length = s.Length;
51 int bytesCommon;
52 fixed (char* pChars = s)
53 {
54 bytesCommon = GetBytesCommon(pChars, length, ptr, 96);
55 }
56 return new Span<byte>(ref *ptr, bytesCommon).ToArray();
57 }
unsafe int GetBytesCommon(char *pChars, int charCount, byte *pBytes, int byteCount)

References System.Text.UTF8Encoding.GetBytesCommon(), System.length, System.s, and System.Span< T >.ToArray().

Referenced by System.Text.UTF8Encoding.UTF8EncodingSealed.GetBytes().