11using System ;
22using System . Text ;
3+ using SysadminsLV . Asn1Parser . Utils . CLRExtensions ;
34
45namespace SysadminsLV . Asn1Parser . Universal ;
56
67/// <summary>
7- /// Represents a <strong>BMPString</strong> ASN.1 tag object. <Strong>BMPString</Strong> is a 16-bit unicode
8+ /// Represents a <strong>BMPString</strong> ASN.1 tag object. <Strong>BMPString</Strong> is a 16-bit Unicode
89/// string where each character is encoded by using two bytes in Big-Endian encoding.
910/// </summary>
1011public sealed class Asn1BMPString : Asn1String {
@@ -22,15 +23,15 @@ public Asn1BMPString(Asn1Reader asn) : base(asn, TYPE) {
2223 m_decode ( asn ) ;
2324 }
2425 /// <summary>
25- /// Initializes a new instance of <strong>Asn1BitString</strong> from a ASN.1-encoded memory buffer.
26+ /// Initializes a new instance of <strong>Asn1BitString</strong> from an ASN.1-encoded memory buffer.
2627 /// </summary>
2728 /// <param name="rawData">ASN.1-encoded memory buffer.</param>
2829 /// <exception cref="Asn1InvalidTagException">
2930 /// <strong>rawData</strong> is not <strong>BMPString</strong> data type.
3031 /// </exception>
3132 public Asn1BMPString ( ReadOnlyMemory < Byte > rawData ) : this ( new Asn1Reader ( rawData ) ) { }
3233 /// <summary>
33- /// Initializes a new instance of the <strong>Asn1BMPString</strong> class from a unicode string.
34+ /// Initializes a new instance of the <strong>Asn1BMPString</strong> class from a Unicode Basic Multilingual Plane string.
3435 /// </summary>
3536 /// <param name="inputString">A unicode string to encode.</param>
3637 public Asn1BMPString ( String inputString ) : base ( TYPE ) {
@@ -42,6 +43,6 @@ void m_encode(String inputString) {
4243 Initialize ( Asn1Utils . EncodeAsReader ( Encoding . BigEndianUnicode . GetBytes ( inputString ) . AsSpan ( ) , TYPE ) ) ;
4344 }
4445 void m_decode ( Asn1Reader asn ) {
45- Value = Encoding . BigEndianUnicode . GetString ( asn . GetPayload ( ) ) ;
46+ Value = Encoding . BigEndianUnicode . GetString ( asn . GetPayloadAsMemory ( ) . Span ) ;
4647 }
4748}
0 commit comments