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

◆ ReadContentAsBytes()

byte[] System.Xml.XmlDictionaryReader.ReadContentAsBytes ( bool base64,
int maxByteArrayContentLength )
inlineprivateinherited

Definition at line 908 of file XmlDictionaryReader.cs.

909 {
910 byte[][] array = new byte[32][];
911 int num = 384;
912 int num2 = 0;
913 int num3 = 0;
914 byte[] array2;
915 while (true)
916 {
917 array2 = new byte[num];
918 array[num2++] = array2;
919 int i;
920 int num4;
921 for (i = 0; i < array2.Length; i += num4)
922 {
923 num4 = ((!base64) ? ReadContentAsBinHex(array2, i, array2.Length - i) : ReadContentAsBase64(array2, i, array2.Length - i));
924 if (num4 == 0)
925 {
926 break;
927 }
928 }
929 num3 += i;
930 if (i < array2.Length)
931 {
932 break;
933 }
934 num *= 2;
935 }
936 array2 = new byte[num3];
937 int num5 = 0;
938 for (int j = 0; j < num2 - 1; j++)
939 {
940 Buffer.BlockCopy(array[j], 0, array2, num5, array[j].Length);
941 num5 += array[j].Length;
942 }
943 Buffer.BlockCopy(array[num2 - 1], 0, array2, num5, num3 - num5);
944 return array2;
945 }

References System.array, System.Buffer.BlockCopy(), System.Xml.Dictionary, System.Xml.XmlDictionaryReader.ReadContentAsBase64(), and System.Xml.XmlDictionaryReader.ReadContentAsBinHex().

Referenced by System.Xml.XmlDictionaryReader.ReadContentAsBase64(), and System.Xml.XmlDictionaryReader.ReadContentAsBinHex().