Byte String
An immutable sequence of bytes.
Byte strings compare lexicographically as a sequence of unsigned bytes. That is, the byte string ff
sorts after 00
. This is counter to the sort order of the corresponding bytes, where -1
sorts before 0
.
Full disclosure: this class provides untrusted input and output streams with raw access to the underlying byte array. A hostile stream implementation could keep a reference to the mutable byte string, violating the immutable guarantee of this class. For this reason a byte string's immutability guarantee cannot be relied upon for security in applets and other environments that run both trusted and untrusted code in the same process.
Types
Functions
asByteBuffer
Link copied to clipboard
compareTo
Link copied to clipboard
hmacSha1
Link copied to clipboard
hmacSha256
Link copied to clipboard
hmacSha512
Link copied to clipboard
lastIndexOf
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
@JvmOverloads()
Content copied to clipboard
md5
Link copied to clipboard
rangeEquals
Link copied to clipboard
fun rangeEquals(offset: Int, other: ByteString, otherOffset: Int, byteCount: Int): Boolean
Content copied to clipboard
open fun rangeEquals(offset: Int, other: ByteString, otherOffset: Int, byteCount: Int): Boolean
Content copied to clipboard
sha1
Link copied to clipboard
sha256
Link copied to clipboard
sha512
Link copied to clipboard
startsWith
Link copied to clipboard
substring
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
toAsciiLowercase
Link copied to clipboard
toAsciiUppercase
Link copied to clipboard
toByteArray
Link copied to clipboard
write
Link copied to clipboard