Reference documentation and code samples for the Cloud Bigtable V2 Client class OrderedCodeBytes.
Fields are encoded independently and concatenated with the fixed byte
pair {0x00, 0x01} in between.
Any null (0x00) byte in an encoded field is replaced by the fixed byte
pair {0x00, 0xFF}.
Fields that encode to the empty string "" have special handling:
If every field encodes to "", or if the STRUCT has no fields
defined, then the STRUCT is encoded as the fixed byte pair
{0x00, 0x00}.
Otherwise, the STRUCT only encodes until the last non-empty field,
omitting any trailing empty fields. Any empty fields that aren't
omitted are replaced with the fixed byte pair {0x00, 0x00}.
Examples:
STRUCT() -> "\00\00"
STRUCT("") -> "\00\00"
STRUCT("", "") -> "\00\00"
STRUCT("", "B") -> "\00\00" + "\00\01" + "B"
STRUCT("A", "") -> "A"
STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B"
STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
Since null bytes are always escaped, this encoding can cause size
blowup for encodings like Int64.BigEndianBytes that are likely to
produce many such bytes.
Sorted mode:
Fields are encoded in sorted mode.
All values supported by the field encodings are allowed
Element-wise order is preserved: A < B if A[0] < B[0], or if
A[0] == B[0] && A[1] < B[1], etc. Strict prefixes sort first.
Distinct mode:
Fields are encoded in distinct mode.
All values supported by the field encodings are allowed.
Generated from protobuf message google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes
Namespace
Google \ Cloud \ Bigtable \ Admin \ V2 \ Type \ Struct \ Encoding
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Cloud Bigtable V2 Client - Class OrderedCodeBytes (2.17.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.1 (latest)](/php/docs/reference/cloud-bigtable/latest/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.17.0](/php/docs/reference/cloud-bigtable/2.17.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.16.0](/php/docs/reference/cloud-bigtable/2.16.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.15.0](/php/docs/reference/cloud-bigtable/2.15.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.14.0](/php/docs/reference/cloud-bigtable/2.14.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.13.0](/php/docs/reference/cloud-bigtable/2.13.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.12.0](/php/docs/reference/cloud-bigtable/2.12.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.11.1](/php/docs/reference/cloud-bigtable/2.11.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.9.1](/php/docs/reference/cloud-bigtable/2.9.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.8.0](/php/docs/reference/cloud-bigtable/2.8.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.7.0](/php/docs/reference/cloud-bigtable/2.7.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.6.3](/php/docs/reference/cloud-bigtable/2.6.3/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.5.0](/php/docs/reference/cloud-bigtable/2.5.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.4.0](/php/docs/reference/cloud-bigtable/2.4.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.3.0](/php/docs/reference/cloud-bigtable/2.3.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.2.1](/php/docs/reference/cloud-bigtable/2.2.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.1.0](/php/docs/reference/cloud-bigtable/2.1.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [2.0.1](/php/docs/reference/cloud-bigtable/2.0.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.32.1](/php/docs/reference/cloud-bigtable/1.32.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.31.1](/php/docs/reference/cloud-bigtable/1.31.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.30.0](/php/docs/reference/cloud-bigtable/1.30.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.29.2](/php/docs/reference/cloud-bigtable/1.29.2/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.28.3](/php/docs/reference/cloud-bigtable/1.28.3/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.27.0](/php/docs/reference/cloud-bigtable/1.27.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.26.2](/php/docs/reference/cloud-bigtable/1.26.2/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.25.0](/php/docs/reference/cloud-bigtable/1.25.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.24.1](/php/docs/reference/cloud-bigtable/1.24.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.23.0](/php/docs/reference/cloud-bigtable/1.23.0/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.22.2](/php/docs/reference/cloud-bigtable/1.22.2/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.21.1](/php/docs/reference/cloud-bigtable/1.21.1/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes)\n- [1.20.3](/php/docs/reference/cloud-bigtable/1.20.3/Admin.V2.Type.Struct.Encoding.OrderedCodeBytes) \nReference documentation and code samples for the Cloud Bigtable V2 Client class OrderedCodeBytes.\n\nFields are encoded independently and concatenated with the fixed byte\npair {0x00, 0x01} in between.\n\nAny null (0x00) byte in an encoded field is replaced by the fixed byte\npair {0x00, 0xFF}.\nFields that encode to the empty string \"\" have special handling:\n\n- If *every* field encodes to \"\", or if the STRUCT has no fields defined, then the STRUCT is encoded as the fixed byte pair {0x00, 0x00}.\n- Otherwise, the STRUCT only encodes until the last non-empty field, omitting any trailing empty fields. Any empty fields that aren't omitted are replaced with the fixed byte pair {0x00, 0x00}. Examples:\n- STRUCT() -\\\u003e \"\\\\00\\\\00\"\n- STRUCT(\"\") -\\\u003e \"\\\\00\\\\00\"\n- STRUCT(\"\", \"\") -\\\u003e \"\\\\00\\\\00\"\n- STRUCT(\"\", \"B\") -\\\u003e \"\\\\00\\\\00\" + \"\\\\00\\\\01\" + \"B\"\n- STRUCT(\"A\", \"\") -\\\u003e \"A\"\n- STRUCT(\"\", \"B\", \"\") -\\\u003e \"\\\\00\\\\00\" + \"\\\\00\\\\01\" + \"B\"\n- STRUCT(\"A\", \"\", \"C\") -\\\u003e \"A\" + \"\\\\00\\\\01\" + \"\\\\00\\\\00\" + \"\\\\00\\\\01\" + \"C\" Since null bytes are always escaped, this encoding can cause size blowup for encodings like `Int64.BigEndianBytes` that are likely to produce many such bytes. Sorted mode:\n- Fields are encoded in sorted mode.\n- All values supported by the field encodings are allowed\n- Element-wise order is preserved: `A \u003c B` if `A[0] \u003c B[0]`, or if `A[0] == B[0] && A[1] \u003c B[1]`, etc. Strict prefixes sort first. Distinct mode:\n- Fields are encoded in distinct mode.\n- All values supported by the field encodings are allowed.\n\nGenerated from protobuf message `google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Bigtable \\\\ Admin \\\\ V2 \\\\ Type \\\\ Struct \\\\ Encoding\n\nMethods\n-------\n\n### __construct\n\nConstructor."]]