ToStringUtils

Helper methods to ease implementing Object.toString.

Functions

Link copied to clipboard
fun byteArray(buffer: StringBuilder, bytes: ByteArray)
Link copied to clipboard

Builds a String with both textual representation of the BytesRef data and the bytes hex values. For example: "hello [68 65 6c 6c 6f]". If the content is not a valid UTF-8 sequence, only the bytes hex values are returned, as per BytesRef.toString.

Link copied to clipboard

Unlike Long.toHexString returns a String with a "0x" prefix and all the leading zeros.