Companion

object Companion

Functions

decodeBase64
Link copied to clipboard
common
fun String.decodeBase64(): ByteString?
Decodes the Base64-encoded bytes and returns their value as a byte string.
fun String.decodeBase64(): ByteString?
decodeHex
Link copied to clipboard
common
fun String.decodeHex(): ByteString
Decodes the hex-encoded bytes and returns their value a byte string.
fun String.decodeHex(): ByteString
encode
Link copied to clipboard
@JvmName(name = encodeString)
fun String.encode(charset: Charset = Charsets.UTF_8): ByteString
Returns a new ByteString containing the charset-encoded bytes of this String.
encodeUtf8
Link copied to clipboard
common
fun String.encodeUtf8(): ByteString
Returns a new byte string containing the UTF-8 bytes of this String.
fun String.encodeUtf8(): ByteString
of
Link copied to clipboard
common
fun of(vararg data: Byte): ByteString
Returns a new byte string containing a clone of the bytes of data.
fun of(vararg data: Byte): ByteString
readByteString
Link copied to clipboard
@JvmName(name = read)
fun InputStream.readByteString(byteCount: Int): ByteString
Reads count bytes from this InputStream and returns the result.
toByteString
Link copied to clipboard
@JvmName(name = of)
fun ByteBuffer.toByteString(): ByteString
Returns a ByteString containing a copy of this ByteBuffer.
common
fun ByteArray.toByteString(offset: Int = 0, byteCount: Int = size): ByteString
Returns a new ByteString containing a copy of byteCount bytes of this ByteArray starting at offset.
@JvmName(name = of)
fun ByteArray.toByteString(offset: Int = 0, byteCount: Int = size): ByteString

Properties

EMPTY
Link copied to clipboard
val EMPTY: ByteString
A singleton empty ByteString.
val EMPTY: ByteString