Jaa


AsnWriter.WriteBitString Method

Definition

Write a Bit String value with a specified tag.

public void WriteBitString (ReadOnlySpan<byte> value, int unusedBitCount = 0, System.Formats.Asn1.Asn1Tag? tag = default);
member this.WriteBitString : ReadOnlySpan<byte> * int * Nullable<System.Formats.Asn1.Asn1Tag> -> unit
Public Sub WriteBitString (value As ReadOnlySpan(Of Byte), Optional unusedBitCount As Integer = 0, Optional tag As Nullable(Of Asn1Tag) = Nothing)

Parameters

value
ReadOnlySpan<Byte>

The value to write.

unusedBitCount
Int32

The number of trailing bits which are not semantic.

tag
Nullable<Asn1Tag>

The tag to write, or null for the default tag (Universal 3).

Exceptions

tag.TagClass is Universal, but tag.TagValue is not correct for the method.

 -or-

 <code data-dev-comment-type="paramref">value</code> has length 0 and <code data-dev-comment-type="paramref">unusedBitCount</code> is not 0

 -or-

 <code data-dev-comment-type="paramref">value</code> is not empty and any of the bits identified by
 <code data-dev-comment-type="paramref">unusedBitCount</code> is set.

unusedBitCount is not in the range [0,7].

Applies to