AsnReader.TryReadCharacterStringBytes Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads the next value as character string with the specified tag, copying the unprocessed bytes into a provided destination buffer.
public:
bool TryReadCharacterStringBytes(Span<System::Byte> destination, System::Formats::Asn1::Asn1Tag expectedTag, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryReadCharacterStringBytes (Span<byte> destination, System.Formats.Asn1.Asn1Tag expectedTag, out int bytesWritten);
member this.TryReadCharacterStringBytes : Span<byte> * System.Formats.Asn1.Asn1Tag * int -> bool
Public Function TryReadCharacterStringBytes (destination As Span(Of Byte), expectedTag As Asn1Tag, ByRef bytesWritten As Integer) As Boolean
Parameters
- expectedTag
- Asn1Tag
The tag to check for before reading.
- bytesWritten
- Int32
On success, receives the number of bytes written to destination
.
Returns
true
and advances the reader if destination
had sufficient length to receive the value, otherwise false
and the reader does not advance.
Exceptions
The next value does not have the correct tag.
-or-
The length encoding is not valid under the current encoding rules.
-or-
The contents are not valid under the current encoding rules.
Remarks
This method does not determine if the string used only characters defined by the encoding.