Note that row key may not have ever been written to or read from, and users should therefore
not make any assumptions about the row key structure that are specific to their use case.
Approximate total storage space used by all rows in the table which precede #getKey().
Buffering the contents of all rows between two subsequent samples would require space roughly
equal to the difference in their #getOffsetBytes() fields.
[[["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-18 UTC."],[],[],null,["# Class KeyOffset (2.65.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.65.0 (latest)](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.63.0](/java/docs/reference/google-cloud-bigtable/2.63.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.62.0](/java/docs/reference/google-cloud-bigtable/2.62.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.61.0](/java/docs/reference/google-cloud-bigtable/2.61.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.60.0](/java/docs/reference/google-cloud-bigtable/2.60.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.59.0](/java/docs/reference/google-cloud-bigtable/2.59.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.58.2](/java/docs/reference/google-cloud-bigtable/2.58.2/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.56.0](/java/docs/reference/google-cloud-bigtable/2.56.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.54.0](/java/docs/reference/google-cloud-bigtable/2.54.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.52.0](/java/docs/reference/google-cloud-bigtable/2.52.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.51.2](/java/docs/reference/google-cloud-bigtable/2.51.2/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.49.0](/java/docs/reference/google-cloud-bigtable/2.49.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.46.0](/java/docs/reference/google-cloud-bigtable/2.46.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.45.1](/java/docs/reference/google-cloud-bigtable/2.45.1/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.44.1](/java/docs/reference/google-cloud-bigtable/2.44.1/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.43.0](/java/docs/reference/google-cloud-bigtable/2.43.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.42.0](/java/docs/reference/google-cloud-bigtable/2.42.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.40.0](/java/docs/reference/google-cloud-bigtable/2.40.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.39.5](/java/docs/reference/google-cloud-bigtable/2.39.5/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.37.0](/java/docs/reference/google-cloud-bigtable/2.37.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.35.1](/java/docs/reference/google-cloud-bigtable/2.35.1/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.34.0](/java/docs/reference/google-cloud-bigtable/2.34.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.33.0](/java/docs/reference/google-cloud-bigtable/2.33.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.32.0](/java/docs/reference/google-cloud-bigtable/2.32.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.31.0](/java/docs/reference/google-cloud-bigtable/2.31.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.30.0](/java/docs/reference/google-cloud-bigtable/2.30.0/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.29.1](/java/docs/reference/google-cloud-bigtable/2.29.1/com.google.cloud.bigtable.data.v2.models.KeyOffset)\n- [2.28.0](/java/docs/reference/google-cloud-bigtable/2.28.0/com.google.cloud.bigtable.data.v2.models.KeyOffset) \n\n public abstract class KeyOffset implements Serializable\n\nRepresents the offset of a row key in a table. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e KeyOffset \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### create(ByteString key, long offsetBytes)\n\n public static KeyOffset create(ByteString key, long offsetBytes)\n\n| **Internal Only**: This feature is not stable for application use.\n\nConstructors\n------------\n\n### KeyOffset()\n\n public KeyOffset()\n\nMethods\n-------\n\n### getKey()\n\n public abstract ByteString getKey()\n\nA row key value that is returned as part of the response of [com.google.cloud.bigtable.data.v2.BigtableDataClient#sampleRowKeysAsync(String)](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.BigtableDataClient#com_google_cloud_bigtable_data_v2_BigtableDataClient_sampleRowKeysAsync_java_lang_String_). The key\nrepresents end boundary of one of the contiguous sections in a list of approximately equal\nsized sections.\n\nNote that row key may not have ever been written to or read from, and users should therefore\nnot make any assumptions about the row key structure that are specific to their use case.\n\n### getOffsetBytes()\n\n public abstract long getOffsetBytes()\n\nApproximate total storage space used by all rows in the table which precede [#getKey()](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.KeyOffset#com_google_cloud_bigtable_data_v2_models_KeyOffset_getKey__).\nBuffering the contents of all rows between two subsequent samples would require space roughly\nequal to the difference in their [#getOffsetBytes()](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.KeyOffset#com_google_cloud_bigtable_data_v2_models_KeyOffset_getOffsetBytes__) fields."]]