The class provides functionality for the ASN.1 BIT STRING type. BitString can be converted to System.Collections.BitArray
using the ToBitArray() method. BitString supports iteration through boolean values using the foreach construction.
More...
Inherits IEnumerable< bool >.
|
byte[] | Buffer [get, set] |
| Gets or sets a byte array that represents the current BitString object. The bits in the byte array are arranged from left to right, where bit 0 is mapped to byte[0].bit8, bit 1 mapped to byte[0].bit7, etc.
|
|
int | Length [get, set] |
| Gets or sets the number of elements in a BitArray. When Length is set to a value that is less than Count , BitArray is truncated and the elements located after the Length - 1 value are deleted. When Length is set to a value that is greater than Count , the new elements are set to false.
|
|
bool | this[int index] [get, set] |
| Gets or sets the value of a bit at a specific position in a BitString. More...
|
|
The class provides functionality for the ASN.1 BIT STRING type. BitString can be converted to System.Collections.BitArray
using the ToBitArray() method. BitString supports iteration through boolean values using the foreach construction.
◆ BitString() [1/6]
Oss.Nas.BitString.BitString |
( |
int |
length | ) |
|
|
inline |
Initializes a new instance of the BitString class that can hold the specified number of bit values, which are initially set to false.
- Parameters
-
length | The number of bit values in the new BitString. |
- Exceptions
-
System.ArgumentException | Is thrown when length is less than zero. |
◆ BitString() [2/6]
Oss.Nas.BitString.BitString |
( |
BitString |
value | ) |
|
|
inline |
Initializes a new instance of the BitString class that contains bit values copied from the specified BitString.
- Parameters
-
value | BitString containing the values to copy. |
◆ BitString() [3/6]
Oss.Nas.BitString.BitString |
( |
BitArray |
bitArray | ) |
|
|
inline |
Initializes a new instance of the BitString class that contains bit values copied from the specified BitArray.
- Parameters
-
bitArray | BitArray containing the values to copy. |
◆ BitString() [4/6]
Oss.Nas.BitString.BitString |
( |
bool[] |
boolArray | ) |
|
|
inline |
Initializes a new instance of the BitString class that contains bit values copied from the specified boolean array.
- Parameters
-
boolArray | A boolean array containing the values to copy. |
◆ BitString() [5/6]
Oss.Nas.BitString.BitString |
( |
byte[] |
byteArray, |
|
|
int |
nbits |
|
) |
| |
|
inline |
Initializes a new instance of the BitString class that contains bit values copied from the specified array of bytes.
- Parameters
-
byteArray | An array of bytes containing the values to copy. Bits in the byte array are arranged from left to right, where bit 0 is mapped to byte[0].bit8, bit 1 mapped to byte[0].bit7, etc. |
nbits | The number of bits to copy. |
◆ BitString() [6/6]
Oss.Nas.BitString.BitString |
( |
byte[] |
byteArray | ) |
|
|
inline |
Initializes a new instance of the BitString class that contains bit values copied from the specified array of bytes.
- Parameters
-
byteArray | An array of bytes containing the values to copy. Bits in the byte array are arranged from left to right, where bit 0 is mapped to byte[0].bit8, bit 1 mapped to byte[0].bit7, etc. |
◆ And()
Performs the bitwise AND operation on the elements in the current BitString against the corresponding elements in the specified BitString.
- Parameters
-
value | BitString with which to perform the bitwise AND operation. |
- Returns
- The current instance containing the result of the bitwise AND operation on the elements in the current BitString against the corresponding elements in the specified BitString.
- Exceptions
-
System.ArgumentException | Is thrown when the lengths do not match. |
◆ Copy()
virtual object Oss.Nas.BitString.Copy |
( |
| ) |
|
|
inlinevirtual |
Creates a deep copy of this object.
- Returns
- A new BitString object with the same value.
◆ Equals()
override bool Oss.Nas.BitString.Equals |
( |
Object |
obj | ) |
|
|
inline |
BitString objects are equal if they have the same length and identical bit values.
- Parameters
-
- Returns
- True if the specified BitString is equal to the current BitString; otherwise, false.
◆ GetEnumerator()
IEnumerator< bool > Oss.Nas.BitString.GetEnumerator |
( |
| ) |
|
|
inline |
Returns an enumerator that iterates through a BitString.
- Returns
- An IEnumerator for the entire BitString.
◆ GetHashCode()
override int Oss.Nas.BitString.GetHashCode |
( |
| ) |
|
|
inline |
Gets hash code.
- Returns
- A hash code value.
◆ Not()
Inverts all the bit values in the current BitString.
- Returns
- The current instance with inverted bit values.
◆ Or()
Performs the bitwise OR operation on the elements in the current BitString against the corresponding elements in the specified BitString.
- Parameters
-
value | BitString with which to perform the bitwise OR operation. |
- Returns
- The current instance containing the result of the bitwise OR operation on the elements in the current BitString against the corresponding elements in the specified BitString.
- Exceptions
-
System.ArgumentException | Is thrown when the lengths do not match. |
◆ ToBitArray()
BitArray Oss.Nas.BitString.ToBitArray |
( |
| ) |
|
|
inline |
Returns a BitArray that represents the current BitString object.
- Returns
- A BitArray that represents the current object.
◆ Xor()
Performs the bitwise XOR operation on the elements in the current BitString against the corresponding elements in the specified BitString.
- Parameters
-
value | BitString with which to perform the bitwise XOR operation. |
- Returns
- The current instance containing the result of the bitwise XOR operation on the elements in the current BitString against the corresponding elements in the specified BitString.
- Exceptions
-
System.ArgumentException | Is thrown when the lengths do not match. |
◆ this[int index]
bool Oss.Nas.BitString.this[int index] |
|
getset |
Gets or sets the value of a bit at a specific position in a BitString.
- Parameters
-
index | The zero-based index of the value to get or set. |
- Returns
- The value of the bit at position index.
- Exceptions
-
System.IndexOutOfRangeException | Is thrown when index is out of range. |