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

◆ WriteTextNodeWithLength()

void System.Xml.XmlBinaryNodeWriter.WriteTextNodeWithLength ( XmlBinaryNodeType nodeType,
int length )
inlineprivate

Definition at line 171 of file XmlBinaryNodeWriter.cs.

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 }
byte[] GetTextNodeBuffer(int size, out int offset)

References System.Xml.XmlStreamNodeWriter.Advance(), System.Xml.Dictionary, System.Xml.XmlBinaryNodeWriter.GetTextNodeBuffer(), System.length, and System.offset.

Referenced by System.Xml.XmlBinaryNodeWriter.UnsafeWriteText(), System.Xml.XmlBinaryNodeWriter.WriteBase64Text(), and System.Xml.XmlBinaryNodeWriter.WriteText().