AsnReader.TryReadPrimitiveBitString(Int32, ReadOnlyMemory<Byte>, Nullable<Asn1Tag>) Método

Definição

Lê o próximo valor como uma CADEIA DE CARACTERES DE BITS com uma marca especificada, retornando o conteúdo como uma ReadOnlyMemory<T> dos dados originais.Reads the next value as a BIT STRING with a specified tag, returning the contents as a ReadOnlyMemory<T> over the original data.

public bool TryReadPrimitiveBitString (out int unusedBitCount, out ReadOnlyMemory<byte> value, System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.TryReadPrimitiveBitString : int * ReadOnlyMemory * Nullable<System.Formats.Asn1.Asn1Tag> -> bool
Public Function TryReadPrimitiveBitString (ByRef unusedBitCount As Integer, ByRef value As ReadOnlyMemory(Of Byte), Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As Boolean

Parâmetros

unusedBitCount
Int32

Em caso de sucesso, recebe no último byte o número de bits que foram relatados como "não utilizados" pelo gravador.On success, receives the number of bits in the last byte which were reported as "unused" by the writer.

value
ReadOnlyMemory<Byte>

Em caso de sucesso, recebe uma ReadOnlyMemory<T> dos dados originais correspondentes ao valor da CADEIA DE CARACTERES DE BITS.On success, receives a ReadOnlyMemory<T> over the original data corresponding to the value of the BIT STRING.

expectedTag
Nullable<Asn1Tag>

A marca a ser verificada antes da leitura ou null para a marca padrão (Universal 1).The tag to check for before reading, or null for the default tag (Universal 1).

Retornos

Boolean

true e avançará o leitor se o valor da CADEIA DE CARACTERES DE BITS tiver uma codificação primitiva, false e não avançará o leitor se ele tiver uma codificação construída.true and advances the reader if the BIT STRING value had a primitive encoding, false and does not advance the reader if it had a constructed encoding.

Exceções

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.

expectedTag.TagClassexpectedTag.TagClass é Universal, mas expectedTag.TagValueis Universal, but expectedTag.TagValue não está correto para o método.is not correct for the method.

Aplica-se a