Companion

actual object Companion
expect object Companion
actual object Companion
actual object Companion

Properties

Link copied to clipboard
actual val EMPTY: ByteString

A singleton empty ByteString.

actual val EMPTY: ByteString

Functions

Link copied to clipboard

Decodes the Base64-encoded bytes and returns their value as a byte string. Returns null if this is not a Base64-encoded sequence of bytes.

Link copied to clipboard

Decodes the hex-encoded bytes and returns their value a byte string.

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.

Link copied to clipboard

Returns a new byte string containing the UTF-8 bytes of this String.

Link copied to clipboard
actual fun of(vararg data: Byte): ByteString
expect fun of(vararg data: Byte): ByteString

Returns a new byte string containing a clone of the bytes of data.

actual fun of(vararg data: Byte): ByteString
actual fun of(vararg data: Byte): ByteString
Link copied to clipboard
@JvmName(name = "read")
fun InputStream.readByteString(byteCount: Int): ByteString

Reads count bytes from this InputStream and returns the result.

Link copied to clipboard
fun <Error class: unknown class>.toByteString(): ByteString
actual fun ByteArray.toByteString(offset: Int, byteCount: Int): ByteString
expect fun ByteArray.toByteString(offset: Int = 0, byteCount: Int = DEFAULT__ByteString_size): ByteString

Returns a new ByteString containing a copy of byteCount bytes of this ByteArray starting at offset.

Returns a ByteString containing a copy of this ByteBuffer.

@JvmName(name = "of")
actual fun ByteArray.toByteString(offset: Int, byteCount: Int): ByteString
actual fun ByteArray.toByteString(offset: Int, byteCount: Int): ByteString