Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlBinaryNodeWriter.cs
Go to the documentation of this file.
1using System.IO;
3using System.Text;
4
5namespace System.Xml;
6
8{
9 private struct AttributeValue
10 {
11 private string _captureText;
12
14
16
17 public void Clear()
18 {
19 _captureText = null;
20 _captureXText = null;
21 _captureStream = null;
22 }
23
24 public void WriteText(string s)
25 {
26 if (_captureStream != null)
27 {
30 _captureText = XmlConverter.Base64Encoding.GetString(buffer.Array, buffer.Offset, buffer.Count);
31 _captureStream = null;
32 }
33 if (_captureXText != null)
34 {
36 _captureXText = null;
37 }
38 if (_captureText == null || _captureText.Length == 0)
39 {
41 }
42 else
43 {
44 _captureText += s;
45 }
46 }
47
49 {
50 if (_captureText != null || _captureStream != null)
51 {
52 WriteText(s.Value);
53 }
54 else
55 {
57 }
58 }
59
60 public void WriteBase64Text(byte[] trailBytes, int trailByteCount, byte[] buffer, int offset, int count)
61 {
62 if (_captureText != null || _captureXText != null)
63 {
64 if (trailByteCount > 0)
65 {
67 }
69 return;
70 }
71 if (_captureStream == null)
72 {
74 }
75 if (trailByteCount > 0)
76 {
78 }
80 }
81
83 {
84 if (_captureText != null)
85 {
86 writer.WriteText(_captureText);
87 _captureText = null;
88 }
89 else if (_captureXText != null)
90 {
91 writer.WriteText(_captureXText);
92 _captureXText = null;
93 }
94 else if (_captureStream != null)
95 {
98 writer.WriteBase64Text(null, 0, buffer.Array, buffer.Offset, buffer.Count);
99 _captureStream = null;
100 }
101 else
102 {
103 writer.WriteEmptyText();
104 }
105 }
106 }
107
109
111
112 private bool _inAttribute;
113
114 private bool _inList;
115
117
119
120 private const int maxBytesPerChar = 3;
121
122 private int _textNodeOffset;
123
134
135 private void WriteNode(XmlBinaryNodeType nodeType)
136 {
137 WriteByte((byte)nodeType);
138 _textNodeOffset = -1;
139 }
140
149
150 private void WriteTextNode(XmlBinaryNodeType nodeType)
151 {
152 if (_inAttribute)
153 {
155 }
156 WriteByte((byte)nodeType);
158 }
159
160 private byte[] GetTextNodeBuffer(int size, out int offset)
161 {
162 if (_inAttribute)
163 {
165 }
166 byte[] buffer = GetBuffer(size, out offset);
168 return buffer;
169 }
170
172 {
173 int offset;
175 if (length < 256)
176 {
177 textNodeBuffer[offset] = (byte)nodeType;
178 textNodeBuffer[offset + 1] = (byte)length;
179 Advance(2);
180 }
181 else if (length < 65536)
182 {
183 textNodeBuffer[offset] = (byte)(nodeType + 2);
184 textNodeBuffer[offset + 1] = (byte)length;
185 length >>= 8;
186 textNodeBuffer[offset + 2] = (byte)length;
187 Advance(3);
188 }
189 else
190 {
191 textNodeBuffer[offset] = (byte)(nodeType + 4);
192 textNodeBuffer[offset + 1] = (byte)length;
193 length >>= 8;
194 textNodeBuffer[offset + 2] = (byte)length;
195 length >>= 8;
196 textNodeBuffer[offset + 3] = (byte)length;
197 length >>= 8;
198 textNodeBuffer[offset + 4] = (byte)length;
199 Advance(5);
200 }
201 }
202
203 private void WriteTextNodeWithInt64(XmlBinaryNodeType nodeType, long value)
204 {
205 int offset;
207 textNodeBuffer[offset] = (byte)nodeType;
208 textNodeBuffer[offset + 1] = (byte)value;
209 value >>= 8;
210 textNodeBuffer[offset + 2] = (byte)value;
211 value >>= 8;
212 textNodeBuffer[offset + 3] = (byte)value;
213 value >>= 8;
214 textNodeBuffer[offset + 4] = (byte)value;
215 value >>= 8;
216 textNodeBuffer[offset + 5] = (byte)value;
217 value >>= 8;
218 textNodeBuffer[offset + 6] = (byte)value;
219 value >>= 8;
220 textNodeBuffer[offset + 7] = (byte)value;
221 value >>= 8;
222 textNodeBuffer[offset + 8] = (byte)value;
223 Advance(9);
224 }
225
226 public override void WriteDeclaration()
227 {
228 }
229
230 public override void WriteStartElement(string prefix, string localName)
231 {
232 if (string.IsNullOrEmpty(prefix))
233 {
234 WriteNode(XmlBinaryNodeType.MinElement);
235 WriteName(localName);
236 return;
237 }
238 char c = prefix[0];
239 if (prefix.Length == 1 && c >= 'a' && c <= 'z')
240 {
241 WritePrefixNode(XmlBinaryNodeType.PrefixElementA, c - 97);
242 WriteName(localName);
243 }
244 else
245 {
248 WriteName(localName);
249 }
250 }
251
252 private void WritePrefixNode(XmlBinaryNodeType nodeType, int ch)
253 {
254 WriteNode(nodeType + ch);
255 }
256
257 public override void WriteStartElement(string prefix, XmlDictionaryString localName)
258 {
259 if (!TryGetKey(localName, out var key))
260 {
261 WriteStartElement(prefix, localName.Value);
262 return;
263 }
264 if (string.IsNullOrEmpty(prefix))
265 {
266 WriteNode(XmlBinaryNodeType.ShortDictionaryElement);
267 WriteDictionaryString(localName, key);
268 return;
269 }
270 char c = prefix[0];
271 if (prefix.Length == 1 && c >= 'a' && c <= 'z')
272 {
273 WritePrefixNode(XmlBinaryNodeType.PrefixDictionaryElementA, c - 97);
274 WriteDictionaryString(localName, key);
275 }
276 else
277 {
278 WriteNode(XmlBinaryNodeType.DictionaryElement);
280 WriteDictionaryString(localName, key);
281 }
282 }
283
284 public override void WriteEndStartElement(bool isEmpty)
285 {
286 if (isEmpty)
287 {
289 }
290 }
291
292 public override void WriteEndElement(string prefix, string localName)
293 {
295 }
296
297 private void WriteEndElement()
298 {
299 if (_textNodeOffset != -1)
300 {
301 byte[] streamBuffer = base.StreamBuffer;
304 _textNodeOffset = -1;
305 }
306 else
307 {
308 WriteNode(XmlBinaryNodeType.EndElement);
309 }
310 }
311
312 public override void WriteStartAttribute(string prefix, string localName)
313 {
314 if (prefix.Length == 0)
315 {
316 WriteNode(XmlBinaryNodeType.MinAttribute);
317 WriteName(localName);
318 }
319 else
320 {
321 char c = prefix[0];
322 if (prefix.Length == 1 && c >= 'a' && c <= 'z')
323 {
324 WritePrefixNode(XmlBinaryNodeType.PrefixAttributeA, c - 97);
325 WriteName(localName);
326 }
327 else
328 {
329 WriteNode(XmlBinaryNodeType.Attribute);
331 WriteName(localName);
332 }
333 }
334 _inAttribute = true;
335 _wroteAttributeValue = false;
336 }
337
338 public override void WriteStartAttribute(string prefix, XmlDictionaryString localName)
339 {
340 if (!TryGetKey(localName, out var key))
341 {
342 WriteStartAttribute(prefix, localName.Value);
343 return;
344 }
345 if (prefix.Length == 0)
346 {
347 WriteNode(XmlBinaryNodeType.ShortDictionaryAttribute);
348 WriteDictionaryString(localName, key);
349 }
350 else
351 {
352 char c = prefix[0];
353 if (prefix.Length == 1 && c >= 'a' && c <= 'z')
354 {
355 WritePrefixNode(XmlBinaryNodeType.PrefixDictionaryAttributeA, c - 97);
356 WriteDictionaryString(localName, key);
357 }
358 else
359 {
360 WriteNode(XmlBinaryNodeType.DictionaryAttribute);
362 WriteDictionaryString(localName, key);
363 }
364 }
365 _inAttribute = true;
366 _wroteAttributeValue = false;
367 }
368
369 public override void WriteEndAttribute()
370 {
371 _inAttribute = false;
373 {
375 }
376 _textNodeOffset = -1;
377 }
378
379 public override void WriteXmlnsAttribute(string prefix, string ns)
380 {
381 if (string.IsNullOrEmpty(prefix))
382 {
383 WriteNode(XmlBinaryNodeType.ShortXmlnsAttribute);
384 WriteName(ns);
385 }
386 else
387 {
388 WriteNode(XmlBinaryNodeType.XmlnsAttribute);
390 WriteName(ns);
391 }
392 }
393
394 public override void WriteXmlnsAttribute(string prefix, XmlDictionaryString ns)
395 {
396 if (!TryGetKey(ns, out var key))
397 {
399 }
400 else if (string.IsNullOrEmpty(prefix))
401 {
402 WriteNode(XmlBinaryNodeType.ShortDictionaryXmlnsAttribute);
404 }
405 else
406 {
407 WriteNode(XmlBinaryNodeType.DictionaryXmlnsAttribute);
410 }
411 }
412
414 {
415 key = -1;
416 if (s.Dictionary == _dictionary)
417 {
418 key = s.Key * 2;
419 return true;
420 }
422 {
423 key = result.Key * 2;
424 return true;
425 }
426 if (_session == null)
427 {
428 return false;
429 }
431 {
432 return false;
433 }
434 key = key2 * 2 + 1;
435 return true;
436 }
437
442
443 private unsafe void WriteName(string s)
444 {
445 int length = s.Length;
446 if (length == 0)
447 {
448 WriteByte(0);
449 return;
450 }
451 fixed (char* chars = s)
452 {
454 }
455 }
456
457 private unsafe void UnsafeWriteName(char* chars, int charCount)
458 {
459 if (charCount < 42)
460 {
461 int offset;
462 byte[] buffer = GetBuffer(1 + charCount * 3, out offset);
464 buffer[offset] = (byte)num;
465 Advance(1 + num);
466 }
467 else
468 {
472 }
473 }
474
475 private void WriteMultiByteInt32(int i)
476 {
477 int offset;
478 byte[] buffer = GetBuffer(5, out offset);
479 int num = offset;
480 while ((i & 0xFFFFFF80u) != 0L)
481 {
482 buffer[offset++] = (byte)(((uint)i & 0x7Fu) | 0x80u);
483 i >>= 7;
484 }
485 buffer[offset++] = (byte)i;
486 Advance(offset - num);
487 }
488
489 public override void WriteComment(string value)
490 {
493 }
494
495 public override void WriteCData(string value)
496 {
498 }
499
500 private void WriteEmptyText()
501 {
503 }
504
505 public override void WriteBoolText(bool value)
506 {
507 if (value)
508 {
510 }
511 else
512 {
514 }
515 }
516
517 public override void WriteInt32Text(int value)
518 {
519 if (value >= -128 && value < 128)
520 {
521 switch (value)
522 {
523 case 0:
525 return;
526 case 1:
528 return;
529 }
530 int offset;
532 textNodeBuffer[offset] = 136;
533 textNodeBuffer[offset + 1] = (byte)value;
534 Advance(2);
535 }
536 else if (value >= -32768 && value < 32768)
537 {
538 int offset2;
541 textNodeBuffer2[offset2 + 1] = (byte)value;
542 value >>= 8;
543 textNodeBuffer2[offset2 + 2] = (byte)value;
544 Advance(3);
545 }
546 else
547 {
548 int offset3;
551 textNodeBuffer3[offset3 + 1] = (byte)value;
552 value >>= 8;
553 textNodeBuffer3[offset3 + 2] = (byte)value;
554 value >>= 8;
555 textNodeBuffer3[offset3 + 3] = (byte)value;
556 value >>= 8;
557 textNodeBuffer3[offset3 + 4] = (byte)value;
558 Advance(5);
559 }
560 }
561
562 public override void WriteInt64Text(long value)
563 {
564 if (value >= int.MinValue && value <= int.MaxValue)
565 {
566 WriteInt32Text((int)value);
567 }
568 else
569 {
571 }
572 }
573
574 public override void WriteUInt64Text(ulong value)
575 {
576 if (value <= long.MaxValue)
577 {
578 WriteInt64Text((long)value);
579 }
580 else
581 {
583 }
584 }
585
586 private void WriteInt64(long value)
587 {
588 int offset;
589 byte[] buffer = GetBuffer(8, out offset);
590 buffer[offset] = (byte)value;
591 value >>= 8;
592 buffer[offset + 1] = (byte)value;
593 value >>= 8;
594 buffer[offset + 2] = (byte)value;
595 value >>= 8;
596 buffer[offset + 3] = (byte)value;
597 value >>= 8;
598 buffer[offset + 4] = (byte)value;
599 value >>= 8;
600 buffer[offset + 5] = (byte)value;
601 value >>= 8;
602 buffer[offset + 6] = (byte)value;
603 value >>= 8;
604 buffer[offset + 7] = (byte)value;
605 Advance(8);
606 }
607
608 public override void WriteBase64Text(byte[] trailBytes, int trailByteCount, byte[] base64Buffer, int base64Offset, int base64Count)
609 {
610 if (_inAttribute)
611 {
613 return;
614 }
615 int num = trailByteCount + base64Count;
616 if (num > 0)
617 {
619 if (trailByteCount > 0)
620 {
621 int offset;
623 for (int i = 0; i < trailByteCount; i++)
624 {
625 buffer[offset + i] = trailBytes[i];
626 }
628 }
629 if (base64Count > 0)
630 {
632 }
633 }
634 else
635 {
637 }
638 }
639
640 public override void WriteText(XmlDictionaryString value)
641 {
642 if (_inAttribute)
643 {
645 return;
646 }
647 if (!TryGetKey(value, out var key))
648 {
649 WriteText(value.Value);
650 return;
651 }
652 WriteTextNode(XmlBinaryNodeType.DictionaryText);
654 }
655
656 public unsafe override void WriteText(string value)
657 {
658 if (_inAttribute)
659 {
661 }
662 else if (value.Length > 0)
663 {
664 fixed (char* chars = value)
665 {
666 UnsafeWriteText(chars, value.Length);
667 }
668 }
669 else
670 {
672 }
673 }
674
675 public unsafe override void WriteText(char[] chars, int offset, int count)
676 {
677 if (_inAttribute)
678 {
680 }
681 else if (count > 0)
682 {
683 fixed (char* chars2 = &chars[offset])
684 {
686 }
687 }
688 else
689 {
691 }
692 }
693
694 public override void WriteText(byte[] chars, int charOffset, int charCount)
695 {
698 }
699
700 private unsafe void UnsafeWriteText(char* chars, int charCount)
701 {
702 if (charCount == 1)
703 {
704 switch (*chars)
705 {
706 case '0':
708 return;
709 case '1':
711 return;
712 }
713 }
714 if (charCount <= 85)
715 {
716 int offset;
717 byte[] buffer = GetBuffer(2 + charCount * 3, out offset);
719 if (num / 2 <= charCount)
720 {
721 buffer[offset] = 152;
722 }
723 else
724 {
725 buffer[offset] = 182;
727 }
729 buffer[offset + 1] = (byte)num;
730 Advance(2 + num);
731 }
732 else
733 {
735 if (num2 / 2 > charCount)
736 {
739 }
740 else
741 {
744 }
745 }
746 }
747
748 public override void WriteEscapedText(string value)
749 {
751 }
752
754 {
756 }
757
758 public override void WriteEscapedText(char[] chars, int offset, int count)
759 {
761 }
762
763 public override void WriteEscapedText(byte[] chars, int offset, int count)
764 {
766 }
767
768 public override void WriteCharEntity(int ch)
769 {
770 if (ch > 65535)
771 {
773 char[] chars = new char[2] { surrogateChar.HighChar, surrogateChar.LowChar };
774 WriteText(chars, 0, 2);
775 }
776 else
777 {
778 char[] chars2 = new char[1] { (char)ch };
779 WriteText(chars2, 0, 1);
780 }
781 }
782
783 public unsafe override void WriteFloatText(float f)
784 {
785 long value;
786 if (f >= -9.223372E+18f && f <= 9.223372E+18f && (float)(value = (long)f) == f)
787 {
789 return;
790 }
791 int offset;
793 byte* ptr = (byte*)(&f);
794 textNodeBuffer[offset] = 144;
795 textNodeBuffer[offset + 1] = *ptr;
796 textNodeBuffer[offset + 2] = ptr[1];
797 textNodeBuffer[offset + 3] = ptr[2];
798 textNodeBuffer[offset + 4] = ptr[3];
799 Advance(5);
800 }
801
802 public unsafe override void WriteDoubleText(double d)
803 {
804 float value;
805 if (d >= -3.4028234663852886E+38 && d <= 3.4028234663852886E+38 && (double)(value = (float)d) == d)
806 {
808 return;
809 }
810 int offset;
812 byte* ptr = (byte*)(&d);
813 textNodeBuffer[offset] = 146;
814 textNodeBuffer[offset + 1] = *ptr;
815 textNodeBuffer[offset + 2] = ptr[1];
816 textNodeBuffer[offset + 3] = ptr[2];
817 textNodeBuffer[offset + 4] = ptr[3];
818 textNodeBuffer[offset + 5] = ptr[4];
819 textNodeBuffer[offset + 6] = ptr[5];
820 textNodeBuffer[offset + 7] = ptr[6];
821 textNodeBuffer[offset + 8] = ptr[7];
822 Advance(9);
823 }
824
825 public unsafe override void WriteDecimalText(decimal d)
826 {
827 int offset;
829 byte* ptr = (byte*)(&d);
830 textNodeBuffer[offset++] = 148;
831 for (int i = 0; i < 16; i++)
832 {
833 textNodeBuffer[offset++] = ptr[i];
834 }
835 Advance(17);
836 }
837
838 public override void WriteDateTimeText(DateTime dt)
839 {
841 }
842
843 private static long ToBinary(DateTime dt)
844 {
845 long num = 0L;
846 switch (dt.Kind)
847 {
848 case DateTimeKind.Local:
849 num |= long.MinValue;
850 num |= dt.ToUniversalTime().Ticks;
851 break;
852 case DateTimeKind.Utc:
853 num |= 0x4000000000000000L;
854 num |= dt.Ticks;
855 break;
856 case DateTimeKind.Unspecified:
857 num = dt.Ticks;
858 break;
859 }
860 return num;
861 }
862
863 public override void WriteUniqueIdText(UniqueId value)
864 {
865 if (value.IsGuid)
866 {
867 int offset;
869 textNodeBuffer[offset] = 172;
870 value.TryGetGuid(textNodeBuffer, offset + 1);
871 Advance(17);
872 }
873 else
874 {
875 WriteText(value.ToString());
876 }
877 }
878
879 public override void WriteGuidText(Guid guid)
880 {
881 int offset;
883 textNodeBuffer[offset] = 176;
884 Buffer.BlockCopy(guid.ToByteArray(), 0, textNodeBuffer, offset + 1, 16);
885 Advance(17);
886 }
887
888 public override void WriteTimeSpanText(TimeSpan value)
889 {
891 }
892
893 public override void WriteStartListText()
894 {
895 _inList = true;
896 WriteNode(XmlBinaryNodeType.StartListText);
897 }
898
899 public override void WriteListSeparator()
900 {
901 }
902
903 public override void WriteEndListText()
904 {
905 _inList = false;
907 WriteNode(XmlBinaryNodeType.EndListText);
908 }
909
910 public void WriteArrayNode()
911 {
913 }
914
915 private void WriteArrayInfo(XmlBinaryNodeType nodeType, int count)
916 {
917 WriteNode(nodeType);
919 }
920
921 public unsafe void UnsafeWriteArray(XmlBinaryNodeType nodeType, int count, byte* array, byte* arrayMax)
922 {
923 WriteArrayInfo(nodeType, count);
925 }
926
927 private unsafe void UnsafeWriteArray(byte* array, int byteCount)
928 {
930 }
931
933 {
934 WriteArrayInfo(XmlBinaryNodeType.DateTimeTextWithEndElement, count);
935 for (int i = 0; i < count; i++)
936 {
938 }
939 }
940
941 public void WriteGuidArray(Guid[] array, int offset, int count)
942 {
943 WriteArrayInfo(XmlBinaryNodeType.GuidTextWithEndElement, count);
944 for (int i = 0; i < count; i++)
945 {
946 byte[] byteBuffer = array[offset + i].ToByteArray();
947 WriteBytes(byteBuffer, 0, 16);
948 }
949 }
950
952 {
953 WriteArrayInfo(XmlBinaryNodeType.TimeSpanTextWithEndElement, count);
954 for (int i = 0; i < count; i++)
955 {
956 WriteInt64(array[offset + i].Ticks);
957 }
958 }
959
960 public override void WriteQualifiedName(string prefix, XmlDictionaryString localName)
961 {
962 if (prefix.Length == 0)
963 {
964 WriteText(localName);
965 return;
966 }
967 char c = prefix[0];
968 if (prefix.Length == 1 && c >= 'a' && c <= 'z' && TryGetKey(localName, out var key))
969 {
970 WriteTextNode(XmlBinaryNodeType.QNameDictionaryText);
971 WriteByte((byte)(c - 97));
972 WriteDictionaryString(localName, key);
973 }
974 else
975 {
977 WriteText(":");
978 WriteText(localName);
979 }
980 }
981
982 protected override void FlushBuffer()
983 {
984 base.FlushBuffer();
985 _textNodeOffset = -1;
986 }
987
988 public override void Close()
989 {
990 base.Close();
992 }
993}
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
Definition Buffer.cs:102
virtual bool TryGetBuffer(out ArraySegment< byte > buffer)
override void Write(byte[] buffer, int offset, int count)
static string XmlOnlySingleValue
Definition SR.cs:484
Definition SR.cs:7
override void WriteStartElement(string prefix, XmlDictionaryString localName)
override void WriteDateTimeText(DateTime dt)
override void WriteTimeSpanText(TimeSpan value)
override void WriteQualifiedName(string prefix, XmlDictionaryString localName)
static long ToBinary(DateTime dt)
unsafe void UnsafeWriteName(char *chars, int charCount)
override void WriteStartAttribute(string prefix, XmlDictionaryString localName)
void SetOutput(Stream stream, IXmlDictionary dictionary, XmlBinaryWriterSession session, bool ownsStream)
void WriteDateTimeArray(DateTime[] array, int offset, int count)
override void WriteInt32Text(int value)
override void WriteEscapedText(XmlDictionaryString value)
void WriteTimeSpanArray(TimeSpan[] array, int offset, int count)
void WritePrefixNode(XmlBinaryNodeType nodeType, int ch)
override void WriteEscapedText(char[] chars, int offset, int count)
override void WriteBase64Text(byte[] trailBytes, int trailByteCount, byte[] base64Buffer, int base64Offset, int base64Count)
override void WriteEscapedText(byte[] chars, int offset, int count)
unsafe override void WriteFloatText(float f)
unsafe void UnsafeWriteArray(XmlBinaryNodeType nodeType, int count, byte *array, byte *arrayMax)
override void WriteXmlnsAttribute(string prefix, string ns)
override void WriteInt64Text(long value)
unsafe void UnsafeWriteText(char *chars, int charCount)
override void WriteEndStartElement(bool isEmpty)
override void WriteStartAttribute(string prefix, string localName)
void WriteTextNodeWithLength(XmlBinaryNodeType nodeType, int length)
void WriteGuidArray(Guid[] array, int offset, int count)
override void WriteCData(string value)
override void WriteCharEntity(int ch)
unsafe void UnsafeWriteArray(byte *array, int byteCount)
unsafe override void WriteDecimalText(decimal d)
unsafe override void WriteText(string value)
unsafe override void WriteText(char[] chars, int offset, int count)
override void WriteGuidText(Guid guid)
override void WriteEscapedText(string value)
override void WriteStartElement(string prefix, string localName)
override void WriteText(XmlDictionaryString value)
override void WriteEndElement(string prefix, string localName)
void WriteArrayInfo(XmlBinaryNodeType nodeType, int count)
bool TryGetKey(XmlDictionaryString s, out int key)
unsafe override void WriteDoubleText(double d)
void WriteTextNodeWithInt64(XmlBinaryNodeType nodeType, long value)
override void WriteBoolText(bool value)
override void WriteComment(string value)
override void WriteUInt64Text(ulong value)
override void WriteText(byte[] chars, int charOffset, int charCount)
void WriteDictionaryString(XmlDictionaryString s, int key)
override void WriteXmlnsAttribute(string prefix, XmlDictionaryString ns)
void WriteTextNode(XmlBinaryNodeType nodeType)
byte[] GetTextNodeBuffer(int size, out int offset)
void WriteNode(XmlBinaryNodeType nodeType)
override void WriteUniqueIdText(UniqueId value)
bool TryLookup(XmlDictionaryString s, out int key)
virtual bool TryAdd(XmlDictionaryString value, out int key)
static Base64Encoding Base64Encoding
unsafe void UnsafeWriteUnicodeChars(char *chars, int charCount)
unsafe void UnsafeWriteUTF8Chars(char *chars, int charCount)
unsafe int UnsafeGetUTF8Chars(char *chars, int charCount, byte[] buffer, int offset)
unsafe int UnsafeGetUTF8Length(char *chars, int charCount)
unsafe int UnsafeGetUnicodeChars(char *chars, int charCount, byte[] buffer, int offset)
byte[] GetBuffer(int count, out int offset)
unsafe void UnsafeWriteBytes(byte *bytes, int byteCount)
bool TryLookup(string value, [NotNullWhen(true)] out XmlDictionaryString? result)
byte[] ToByteArray()
Definition Guid.cs:681
void WriteBase64Text(byte[] trailBytes, int trailByteCount, byte[] buffer, int offset, int count)