Class BitSequence (3.16.3)

public final class BitSequence extends GeneratedMessageV3 implements BitSequenceOrBuilder

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.

Protobuf type google.firestore.v1.BitSequence

Static Fields

BITMAP_FIELD_NUMBER

public static final int BITMAP_FIELD_NUMBER
Field Value
TypeDescription
int

PADDING_FIELD_NUMBER

public static final int PADDING_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static BitSequence getDefaultInstance()
Returns
TypeDescription
BitSequence

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static BitSequence.Builder newBuilder()
Returns
TypeDescription
BitSequence.Builder

newBuilder(BitSequence prototype)

public static BitSequence.Builder newBuilder(BitSequence prototype)
Parameter
NameDescription
prototypeBitSequence
Returns
TypeDescription
BitSequence.Builder

parseDelimitedFrom(InputStream input)

public static BitSequence parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BitSequence parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static BitSequence parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static BitSequence parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static BitSequence parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static BitSequence parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static BitSequence parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static BitSequence parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static BitSequence parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BitSequence parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static BitSequence parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static BitSequence parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BitSequence
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<BitSequence> parser()
Returns
TypeDescription
Parser<BitSequence>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getBitmap()

public ByteString getBitmap()

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

bytes bitmap = 1;

Returns
TypeDescription
ByteString

The bitmap.

getDefaultInstanceForType()

public BitSequence getDefaultInstanceForType()
Returns
TypeDescription
BitSequence

getPadding()

public int getPadding()

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.

int32 padding = 2;

Returns
TypeDescription
int

The padding.

getParserForType()

public Parser<BitSequence> getParserForType()
Returns
TypeDescription
Parser<BitSequence>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public BitSequence.Builder newBuilderForType()
Returns
TypeDescription
BitSequence.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected BitSequence.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
BitSequence.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public BitSequence.Builder toBuilder()
Returns
TypeDescription
BitSequence.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException