class Bytes : Any
A class that wraps a ByteArray, providing ease-of-use and additional functionality.
| <init> |
Bytes(byteArray: ByteArray)
A class that wraps a ByteArray, providing ease-of-use and additional functionality. |
| byteArray |
val byteArray: ByteArray |
| size |
val size: Int |
| copy |
fun copy(): Bytes
Creates a |
| copyOfRange |
fun copyOfRange(range: IntRange): Bytes
Creates a |
| deserializeToObject |
fun <T : Serializable> deserializeToObject(): T
Convert a Bytes into a T by deserializing it using an ObjectInputStream. |
| equals |
fun equals(other: Any?): Boolean |
| hashCode |
fun hashCode(): Int |
| plus |
operator fun plus(other: Bytes): Bytes
Create a new Bytes that is byteArray with other.byteArray appended directly after. |
| toBase64String |
fun toBase64String(): String
Convert a Bytes into a Base64-encoded String. |
| toByteBuffer |
fun toByteBuffer(): ByteBuffer
Convert a Bytes into a ByteBuffer. |
| toDecodedString |
fun toDecodedString(charset: Charset = Charsets.UTF_8): String
Convert a Bytes into a String by decoding it using the given Charset, assuming it contains character data. |
| toHexString |
fun toHexString(): String
Convert a Bytes into a Hex-encoded String. |
| toInputStream |
fun toInputStream(): InputStream
Convert a Bytes into an InputStream. |
| toString |
fun toString(): String |
| DEFAULT_RANDOM_BYTES_SIZE |
const val DEFAULT_RANDOM_BYTES_SIZE: Int |
| generateRandomBytes |
fun generateRandomBytes(size: Int = DEFAULT_RANDOM_BYTES_SIZE): Bytes
Generate random Bytes of a given size. |