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

◆ ReadCharacterStringCore()

static unsafe string System.Formats.Asn1.AsnDecoder.ReadCharacterStringCore ( ReadOnlySpan< byte > source,
AsnEncodingRules ruleSet,
Asn1Tag expectedTag,
UniversalTagNumber universalTagNumber,
Encoding encoding,
out int bytesConsumed )
inlinestaticprivate

Definition at line 1721 of file AsnDecoder.cs.

1722 {
1723 byte[] rented = null;
1724 int bytesConsumed2;
1726 string result;
1727 if (octetStringContents.Length == 0)
1728 {
1729 result = string.Empty;
1730 }
1731 else
1732 {
1733 fixed (byte* bytes = &MemoryMarshal.GetReference(octetStringContents))
1734 {
1735 try
1736 {
1737 result = encoding.GetString(bytes, octetStringContents.Length);
1738 }
1739 catch (DecoderFallbackException inner)
1740 {
1741 throw new AsnContentException(System.SR.ContentException_DefaultMessage, inner);
1742 }
1743 }
1744 }
1745 if (rented != null)
1746 {
1748 }
1750 return result;
1751 }
static ReadOnlySpan< byte > GetOctetStringContents(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber universalTagNumber, out int bytesConsumed, ref byte[] rented, Span< byte > tmpSpace=default(Span< byte >))
static string ContentException_DefaultMessage
Definition SR.cs:50
Definition SR.cs:7
static void Return(byte[] array, int clearSize=-1)
Definition CryptoPool.cs:12
unsafe string GetString(byte *bytes, int byteCount)
Definition Encoding.cs:973

References System.bytes, System.SR.ContentException_DefaultMessage, System.Formats.Asn1.AsnDecoder.GetOctetStringContents(), System.Text.Encoding.GetString(), System.Security.Cryptography.CryptoPool.Return(), and System.source.

Referenced by System.Formats.Asn1.AsnDecoder.ReadCharacterString().