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

◆ SeekEndOfContents()

static int System.Formats.Asn1.AsnDecoder.SeekEndOfContents ( ReadOnlySpan< byte > source,
AsnEncodingRules ruleSet )
inlinestaticprivate

Definition at line 272 of file AsnDecoder.cs.

273 {
275 int num = 0;
276 int num2 = 1;
277 while (!source2.IsEmpty)
278 {
279 int? contentsLength;
280 int bytesRead;
282 if (asn1Tag == Asn1Tag.EndOfContents)
283 {
285 num2--;
286 if (num2 == 0)
287 {
288 return num;
289 }
290 }
291 if (!contentsLength.HasValue)
292 {
293 num2++;
294 source2 = source2.Slice(bytesRead);
295 num += bytesRead;
296 }
297 else
298 {
300 source2 = source2.Slice(readOnlySpan.Length);
301 num += readOnlySpan.Length;
302 }
303 }
304 throw new AsnContentException();
305 }
static void ValidateEndOfContents(Asn1Tag tag, int? length, int headerLength)
static ReadOnlySpan< byte > Slice(ReadOnlySpan< byte > source, int offset, int length)
static Asn1Tag ReadTagAndLength(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int? contentsLength, out int bytesRead)

References System.Formats.Asn1.Asn1Tag.EndOfContents, System.Formats.Asn1.AsnDecoder.ReadTagAndLength(), System.Formats.Asn1.AsnDecoder.Slice(), System.source, and System.Formats.Asn1.AsnDecoder.ValidateEndOfContents().

Referenced by System.Formats.Asn1.AsnDecoder.GetOctetStringContents(), System.Formats.Asn1.AsnDecoder.ReadBitString(), System.Formats.Asn1.AsnDecoder.ReadSequence(), System.Formats.Asn1.AsnDecoder.ReadSetOf(), and System.Formats.Asn1.AsnDecoder.ValidateLength().