BytesRef

constructor()

Create a BytesRef with EMPTY_BYTES


constructor(bytes: ByteArray, offset: Int, length: Int)

This instance will directly reference bytes w/o making a copy. bytes should not be null.


constructor(bytes: ByteArray)

This instance will directly reference bytes w/o making a copy. bytes should not be null


constructor(capacity: Int)

Create a BytesRef pointing to a new array of size capacity. Offset and length will both be zero.


constructor(text: CharSequence)

Initialize the byte[] from the UTF8 bytes for the provided String.

Parameters

text

This must be well-formed unicode text, with no unpaired surrogates.