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

◆ WriteLength()

void System.Formats.Asn1.AsnWriter.WriteLength ( int length)
inlineprivate

Definition at line 272 of file AsnWriter.cs.

273 {
274 if (length == -1)
275 {
277 _buffer[_offset] = 128;
278 _offset++;
279 return;
280 }
281 if (length < 128)
282 {
284 _buffer[_offset] = (byte)length;
285 _offset++;
286 return;
287 }
292 int num2 = length;
293 do
294 {
295 _buffer[num] = (byte)num2;
296 num2 >>= 8;
297 num--;
298 }
299 while (num2 > 0);
301 }
void EnsureWriteCapacity(int pendingCount)
Definition AsnWriter.cs:246
static int GetEncodedLengthSubsequentByteCount(int length)
Definition AsnWriter.cs:303

References System.Formats.Asn1.AsnWriter._buffer, System.Formats.Asn1.AsnWriter._offset, System.Formats.Asn1.AsnWriter.EnsureWriteCapacity(), System.Formats.Asn1.AsnWriter.GetEncodedLengthSubsequentByteCount(), and System.length.

Referenced by System.Formats.Asn1.AsnWriter.PopTag(), System.Formats.Asn1.AsnWriter.PushTag(), System.Formats.Asn1.AsnWriter.WriteBitStringCore(), System.Formats.Asn1.AsnWriter.WriteBooleanCore(), System.Formats.Asn1.AsnWriter.WriteCharacterStringCore(), System.Formats.Asn1.AsnWriter.WriteConstructedCerBitString(), System.Formats.Asn1.AsnWriter.WriteConstructedCerOctetString(), System.Formats.Asn1.AsnWriter.WriteGeneralizedTimeCore(), System.Formats.Asn1.AsnWriter.WriteIntegerCore(), System.Formats.Asn1.AsnWriter.WriteIntegerCore(), System.Formats.Asn1.AsnWriter.WriteIntegerCore(), System.Formats.Asn1.AsnWriter.WriteIntegerUnsignedCore(), System.Formats.Asn1.AsnWriter.WriteNonNegativeIntegerCore(), System.Formats.Asn1.AsnWriter.WriteNullCore(), System.Formats.Asn1.AsnWriter.WriteObjectIdentifierCore(), System.Formats.Asn1.AsnWriter.WriteOctetStringCore(), and System.Formats.Asn1.AsnWriter.WriteUtcTimeCore().