AsnReader.TryReadCharacterString(Span<Char>, UniversalTagNumber, Int32, Nullable<Asn1Tag>) Método
Definição
Lê o próximo valor como cadeia de caracteres com a marca especificada e o tipo de codificação, copiando o valor decodificado em um buffer de destino fornecido.Reads the next value as character string with the specified tag and encoding type, copying the decoded value into a provided destination buffer.
public bool TryReadCharacterString (Span<char> destination, System.Formats.Asn1.UniversalTagNumber encodingType, out int charsWritten, System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.TryReadCharacterString : Span<char> * System.Formats.Asn1.UniversalTagNumber * int * Nullable<System.Formats.Asn1.Asn1Tag> -> bool
Public Function TryReadCharacterString (destination As Span(Of Char), encodingType As UniversalTagNumber, ByRef charsWritten As Integer, Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As Boolean
Parâmetros
- encodingType
- UniversalTagNumber
Um dos valores de enumeração representando o tipo de valor a ser processado.One of the enumeration values representing the value type to process.
- charsWritten
- Int32
Em caso de sucesso, recebe o número de caracteres gravados em destination.On success, receives the number of chars written to destination.
A marca a ser verificada antes da leitura ou null para a marca universal apropriada para o tipo de codificação solicitado.The tag to check for before reading, or null for the universal tag that is appropriate to the requested encoding type.
Retornos
true e avançará o leitor se destination tiver comprimento suficiente para receber o valor; caso contrário, false e o leitor não avançará.true and advances the reader if destination had sufficient length to receive the value, otherwise false and the reader does not advance.
Exceções
encodingType não é um tipo de cadeia de caracteres conhecido.encodingType is not a known character string type.
o valor a seguir não tem a marca correta.the next value does not have the correct tag. -ou- a codificação de comprimento não é válida de acordo com as regras de codificação atuais.-or- the length encoding is not valid under the current encoding rules. -ou- o conteúdo não é válido de acordo com as regras de codificação atuais.-or- the contents are not valid under the current encoding rules. -ou- a cadeia de caracteres não foi decodificada com êxito.-or- the string did not successfully decode.
expectedTag.TagClassexpectedTag.TagClass é Universal, mas expectedTag.TagValueis Universal, but expectedTag.TagValue não é o mesmo que encodingType.is not the same as encodingType.