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

◆ ReadBoolean()

static bool System.Formats.Asn1.AsnDecoder.ReadBoolean ( ReadOnlySpan< byte > source,
AsnEncodingRules ruleSet,
out int bytesConsumed,
Asn1Tag? expectedTag = null )
inlinestatic

Definition at line 656 of file AsnDecoder.cs.

657 {
658 int bytesConsumed2;
660 if (primitiveContentSpan.Length != 1)
661 {
662 throw new AsnContentException();
663 }
664 switch (primitiveContentSpan[0])
665 {
666 case 0:
668 return false;
669 default:
671 {
672 throw new AsnContentException(System.SR.ContentException_InvalidUnderCerOrDer_TryBer);
673 }
674 break;
675 case byte.MaxValue:
676 break;
677 }
679 return true;
680 }
static ReadOnlySpan< byte > GetPrimitiveContentSpan(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber tagNumber, out int bytesConsumed)
Definition AsnDecoder.cs:78
static string ContentException_InvalidUnderCerOrDer_TryBer
Definition SR.cs:56
Definition SR.cs:7

References System.Formats.Asn1.Asn1Tag.Boolean, System.SR.ContentException_InvalidUnderCerOrDer_TryBer, System.Formats.Asn1.AsnDecoder.GetPrimitiveContentSpan(), and System.source.

Referenced by System.Formats.Asn1.AsnReader.ReadBoolean(), and System.Formats.Asn1.AsnValueReader.ReadBoolean().