# Google.Cloud.Bigtable.Common.V2 - Struct BigtableByteString (3.3.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.3.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/3.2.0/Google.Cloud.Bigtable.Common.V2.BigtableByteString)
- [3.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/3.1.0/Google.Cloud.Bigtable.Common.V2.BigtableByteString)
- [3.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/3.0.0/Google.Cloud.Bigtable.Common.V2.BigtableByteString)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/2.1.0/Google.Cloud.Bigtable.Common.V2.BigtableByteString)

    public struct BigtableByteString : IComparable, IComparable<BigtableByteString>, IEquatable<BigtableByteString>, IEnumerable<byte>, IEnumerable

Reference documentation and code samples for the Google.Cloud.Bigtable.Common.V2 struct BigtableByteString.

A sequence of bytes which can be used for a row key, column qualifier, or cell value.

## Implements

[IComparable](https://learn.microsoft.com/dotnet/api/system.icomparable), [IComparable](https://learn.microsoft.com/dotnet/api/system.icomparable-1)[BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)[byte](https://learn.microsoft.com/dotnet/api/system.byte), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable)

## Inherited Members

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

## Namespace

[Google.Cloud.Bigtable.Common.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2)

## Assembly

Google.Cloud.Bigtable.Common.V2.dll

## Constructors

### BigtableByteString(ByteString)

    public BigtableByteString(ByteString value)

Creates a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value from a byte string.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` The byte string making up the value. May be null in which case the empty byte string is used. |

### BigtableByteString(params byte\[\])

    public BigtableByteString(params byte[] value)

Creates a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value from an array of bytes.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://learn.microsoft.com/dotnet/api/system.byte` The bytes making up the byte string. May be null in which case the empty byte string is used. |

### BigtableByteString(long)

    public BigtableByteString(long value)

Creates a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value from the big-endian encoding of a signed 64-bit value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://learn.microsoft.com/dotnet/api/system.int64` The 64-bit value which should be used to initialize the byte string. |

### BigtableByteString(string)

    public BigtableByteString(string valueAsUtf8)

Creates a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value from the UTF-8 encoding of a string.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `valueAsUtf8` | `https://learn.microsoft.com/dotnet/api/system.string` The value whose UTF-8 representation should be used to initialize the byte string. May be null in which case the empty byte string is used. |

## Properties

### IsEmpty

    public bool IsEmpty { get; }

Returns true if the byte string is empty, false otherwise.

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

### this\[int\]

    public byte this[int index] { get; }

Returns the byte at index `index`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://learn.microsoft.com/dotnet/api/system.int32` The index in the byte string to return. Must be greater than or equal to 0, and less than [Length](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString#Google_Cloud_Bigtable_Common_V2_BigtableByteString_Length). |

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.byte` | The byte at index `index`. |

### Length

    public int Length { get; }

Gets the number of bytes in the byte string.

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

### Value

    public ByteString Value { get; }

Gets the underlying byte string.

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

## Methods

### Compare(BigtableByteString, BigtableByteString)

    public static int Compare(BigtableByteString x, BigtableByteString y)

Compares two [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) values lexicographically.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `x` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Left value to compare |
| `y` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Right value to compare |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` | true if `x` is less than `y`; otherwise false. |

### CompareTo(BigtableByteString)

    public int CompareTo(BigtableByteString other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` |

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

### CompareTo(object)

    public int CompareTo(object obj)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `obj` | `https://learn.microsoft.com/dotnet/api/system.object` |

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

### GetEnumerator()

    public IEnumerator<byte> GetEnumerator()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1https://learn.microsoft.com/dotnet/api/system.byte` |   |

### GetHashCode()

    public override int GetHashCode()

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

**Overrides** [ValueType.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode)

### ToString()

    public override string ToString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** [ValueType.ToString()](https://learn.microsoft.com/dotnet/api/system.valuetype.tostring)

## Operators

### operator ==(BigtableByteString, BigtableByteString)

    public static bool operator ==(BigtableByteString x, BigtableByteString y)

Operator overload to compare two [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) values for equality.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `x` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Left value to compare |
| `y` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Right value to compare |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` | true if `x` is equal to `y`; otherwise false. |

### explicit operator ByteString(BigtableByteString)

    public static explicit operator ByteString(BigtableByteString value)

Converts the [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value to its underlying byte string.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` The BigtableByteString value to convert. |

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

### explicit operator byte\[\](BigtableByteString)

    public static explicit operator byte[](BigtableByteString value)

Converts the [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value to its underlying byte array.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` The BigtableByteString value to convert. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.byte` |   |

### explicit operator long(BigtableByteString)

    public static explicit operator long(BigtableByteString value)

Converts the [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value to its a signed 64-bit value assuming it is big-endian encoded.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` The BigtableByteString value to convert. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### explicit operator string(BigtableByteString)

    public static explicit operator string(BigtableByteString value)

Converts the [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value to a string assuming it is UTF-8 encoded.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` The BigtableByteString value to convert. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### operator \>(BigtableByteString, BigtableByteString)

    public static bool operator >(BigtableByteString x, BigtableByteString y)

Operator overload to compare two [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) values.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `x` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Left value to compare |
| `y` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Right value to compare |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` | true if `x` is greater than `y`; otherwise false. |

### operator \>=(BigtableByteString, BigtableByteString)

    public static bool operator >=(BigtableByteString x, BigtableByteString y)

Operator overload to compare two [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) values.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `x` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Left value to compare |
| `y` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Right value to compare |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` | true if `x` is greater than or equal `y`; otherwise false. |

### implicit operator BigtableByteString(ByteString)

    public static implicit operator BigtableByteString(ByteString value)

Converts a byte string to a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` The byte string making up the value. May be null in which case the empty byte string is used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` |   |

### implicit operator BigtableByteString(byte\[\])

    public static implicit operator BigtableByteString(byte[] value)

Converts a byte array to a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://learn.microsoft.com/dotnet/api/system.byte` The bytes making up the byte string. May be null in which case the empty byte string is used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` |   |

### implicit operator BigtableByteString(long)

    public static implicit operator BigtableByteString(long value)

Converts the big-endian encoding of a signed 64-bit value to a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://learn.microsoft.com/dotnet/api/system.int64` The 64-bit value which should be used to initialize the byte string. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` |   |

### implicit operator BigtableByteString(string)

    public static implicit operator BigtableByteString(string valueAsUtf8)

Converts the UTF-8 encoding of a string to a [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `valueAsUtf8` | `https://learn.microsoft.com/dotnet/api/system.string` The value whose UTF-8 representation should be used to initialize the byte string. May be null in which case the empty byte string is used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` |   |

### operator !=(BigtableByteString, BigtableByteString)

    public static bool operator !=(BigtableByteString x, BigtableByteString y)

Operator overload to compare two [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) values for inequality.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `x` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Left value to compare |
| `y` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Right value to compare |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` | true if `x` is not equal to `y`; otherwise false. |

### operator \<(BigtableByteString, BigtableByteString)

    public static bool operator <(BigtableByteString x, BigtableByteString y)

Operator overload to compare two [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) values.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `x` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Left value to compare |
| `y` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Right value to compare |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` | true if `x` is less than `y`; otherwise false. |

### operator \<=(BigtableByteString, BigtableByteString)

    public static bool operator <=(BigtableByteString x, BigtableByteString y)

Operator overload to compare two [BigtableByteString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString) values.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `x` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Left value to compare |
| `y` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Bigtable.Common.V2/latest/Google.Cloud.Bigtable.Common.V2.BigtableByteString` Right value to compare |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` | true if `x` is less than or equal `y`; otherwise false. |