4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.0

    public sealed class BitSequence : IMessage<BitSequence>, IEquatable<BitSequence>, IDeepCloneable<BitSequence>, IBufferMessage, IMessage

Reference documentation and code samples for the Firestore v1 API class BitSequence.

A sequence of bits, encoded in a byte array.

Each byte in the `bitmap` byte array stores 8 bits of the sequence. The only
exception is the last byte, which may store 8 *or fewer* bits. The `padding`
defines the number of bits of the last byte to be ignored as "padding". The
values of these "padding" bits are unspecified and must be ignored.

To retrieve the first bit, bit 0, calculate: `(bitmap[0] & 0x01) != 0`.
To retrieve the second bit, bit 1, calculate: `(bitmap[0] & 0x02) != 0`.
To retrieve the third bit, bit 2, calculate: `(bitmap[0] & 0x04) != 0`.
To retrieve the fourth bit, bit 3, calculate: `(bitmap[0] & 0x08) != 0`.
To retrieve bit n, calculate: `(bitmap[n / 8] & (0x01 << (n % 8))) != 0`.

The "size" of a `BitSequence` (the number of bits it contains) is calculated
by this formula: `(bitmap.length * 8) - padding`.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> BitSequence

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BitSequence](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BitSequence), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BitSequence](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BitSequence), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BitSequence](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BitSequence), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Firestore.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)

## Assembly

Google.Cloud.Firestore.V1.dll

## Constructors

### BitSequence()

    public BitSequence()

### BitSequence(BitSequence)

    public BitSequence(BitSequence other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BitSequence` |

## Properties

### Bitmap

    public ByteString Bitmap { get; set; }

The bytes that encode the bit sequence.
May have a length of zero.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` |   |

### Padding

    public int Padding { get; set; }

The number of bits of the last byte in `bitmap` to ignore as "padding".
If the length of `bitmap` is zero, then this value must be `0`.
Otherwise, this value must be between 0 and 7, inclusive.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |