BytesRef
Represents byte[], as a slice (offset + length) into an existing byte[]. The bytes property should never be null; use EMPTY_BYTES if necessary.
Important note: Unless otherwise noted, Lucene uses this class to represent terms that are encoded as UTF8 bytes in the index. To convert them to a String, use utf8ToString.
BytesRef implements Comparable. The underlying byte arrays are sorted lexicographically, numerically treating elements as unsigned.
Constructors
Create a BytesRef with EMPTY_BYTES
This instance will directly reference bytes w/o making a copy. bytes should not be null.
This instance will directly reference bytes w/o making a copy. bytes should not be null
Create a BytesRef pointing to a new array of size capacity. Offset and length will both be zero.
Initialize the byte[] from the UTF8 bytes for the provided String.