toHexString

Formats bytes in this byte string using the specified format.

Note that only HexFormat.upperCase and HexFormat.BytesHexFormat affect formatting.

Parameters

format

the HexFormat to use for formatting, HexFormat.Default by default.

Throws

if the result length is more than String maximum capacity.


fun ByteString.toHexString(startIndex: Int = 0, endIndex: Int = size, format: HexFormat = HexFormat.Default): String(source)

Formats bytes in this byte string using the specified HexFormat.

Note that only HexFormat.upperCase and HexFormat.BytesHexFormat affect formatting.

Parameters

startIndex

the beginning (inclusive) of the subrange to format, 0 by default.

endIndex

the end (exclusive) of the subrange to format, size of this byte string by default.

format

the HexFormat to use for formatting, HexFormat.Default by default.

Throws

when startIndex or endIndex is out of range of this byte string indices.

if the result length is more than String maximum capacity.