Key
A document key: an opaque byte string ordered as unsigned bytes.
Bytes rather than String because the ordering is the load-bearing part. An LSM-tree merges sorted runs, so the comparator is not a detail of the API — it is the one thing every segment ever written has to agree with, forever. Unsigned lexicographic order over bytes is the only choice that is stable under UTF-8: it makes key order agree with code-point order for text keys, while still accepting keys that are not text at all.
String.compareTo would have been the wrong comparator even for string keys — it compares UTF-16 units, so U+FF21 sorts before U+10000 in UTF-8 and after it in UTF-16. The Variant codec has the same rule for field names, for the same reason.
Keys are immutable; the bytes handed to of are copied, and toByteArray copies back out. An empty key is legal and sorts first.
Functions
Whether this key begins with prefix. An empty prefix matches every key.
A copy of the key's bytes.