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

◆ ReadLength()

static ? int System.Formats.Asn1.AsnDecoder.ReadLength ( ReadOnlySpan< byte > source,
AsnEncodingRules ruleSet,
out int bytesConsumed )
inlinestaticprivate

Definition at line 105 of file AsnDecoder.cs.

106 {
107 int? length;
109 {
110 case LengthDecodeStatus.Success:
111 return length;
112 case LengthDecodeStatus.LengthTooBig:
113 throw new AsnContentException(System.SR.ContentException_LengthTooBig);
114 case LengthDecodeStatus.DerIndefinite:
115 case LengthDecodeStatus.LaxEncodingProhibited:
116 throw new AsnContentException(System.SR.ContentException_LengthRuleSetConstraint);
117 default:
118 throw new AsnContentException();
119 }
120 }
static LengthDecodeStatus DecodeLength(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int? length, out int bytesRead)
static string ContentException_LengthTooBig
Definition SR.cs:66
static string ContentException_LengthRuleSetConstraint
Definition SR.cs:64
Definition SR.cs:7

References System.SR.ContentException_LengthRuleSetConstraint, System.SR.ContentException_LengthTooBig, System.Formats.Asn1.AsnDecoder.DecodeLength(), System.length, and System.source.

Referenced by System.Formats.Asn1.AsnDecoder.GetPrimitiveContentSpan(), System.Formats.Asn1.AsnDecoder.ReadEncodedValue(), and System.Formats.Asn1.AsnDecoder.ReadTagAndLength().