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

◆ WriteUTF8() [1/2]

unsafe void System.Reflection.Metadata.BlobBuilder.WriteUTF8 ( string str,
int start,
int length,
bool allowUnpairedSurrogates,
bool prependSize )
inlinepackageinherited

Definition at line 860 of file BlobBuilder.cs.

861 {
862 if (!IsHead)
863 {
864 Throw.InvalidOperationBuilderAlreadyLinked();
865 }
866 fixed (char* ptr = str)
867 {
868 char* ptr2 = ptr + start;
869 int byteLimit = FreeBytes - (prependSize ? 4 : 0);
870 char* remainder;
871 int uTF8ByteCount = BlobUtilities.GetUTF8ByteCount(ptr2, length, byteLimit, out remainder);
872 int num = (int)(remainder - ptr2);
873 int charCount = length - num;
874 int uTF8ByteCount2 = BlobUtilities.GetUTF8ByteCount(remainder, charCount);
875 if (prependSize)
876 {
878 }
881 if (uTF8ByteCount2 > 0)
882 {
886 }
887 }
888 }

References System.Reflection.Metadata.BlobBuilder._buffer, System.Reflection.Metadata.BlobBuilder.AddLength(), System.charCount, System.Reflection.Metadata.BlobBuilder.Expand(), System.Reflection.Metadata.BlobBuilder.FreeBytes, System.Reflection.BlobUtilities.GetUTF8ByteCount(), System.Reflection.Throw.InvalidOperationBuilderAlreadyLinked(), System.Reflection.Metadata.BlobBuilder.IsHead, System.length, System.Reflection.Metadata.BlobBuilder.Length, System.start, System.str, and System.Reflection.Metadata.BlobBuilder.WriteCompressedInteger().