Skip to content

//okio/okio/ByteString

ByteString

[jvm] open class ByteString : Serializable, Comparable

Types

Name Summary
Companion [jvm]
Content
object Companion


Functions

Name Summary
asByteBuffer [jvm]
Brief description
Returns a ByteBuffer view of the bytes in this ByteString.
Content
open fun asByteBuffer(): ByteBuffer


base64 [jvm]
Content
open fun base64():


base64Url [jvm]
Content
open fun base64Url():


compareTo [jvm]
Content
open operator override fun compareTo(other: ByteString):


endsWith [jvm]
Content
fun endsWith(suffix: ByteString):
fun endsWith(suffix: ByteArray):


equals [jvm]
Content
open operator override fun equals(other: Any?):


get [jvm]
Content
@JvmName(name = “getByte”)

operator fun get(index: Int): Byte


hashCode [jvm]
Content
open override fun hashCode():


hex [jvm]
Content
open fun hex(): String


hmacSha1 [jvm]
Brief description
Returns the 160-bit SHA-1 HMAC of this byte string.
Content
open fun hmacSha1(key: ByteString): ByteString


hmacSha256 [jvm]
Brief description
Returns the 256-bit SHA-256 HMAC of this byte string.
Content
open fun hmacSha256(key: ByteString): ByteString


hmacSha512 [jvm]
Brief description
Returns the 512-bit SHA-512 HMAC of this byte string.
Content
open fun hmacSha512(key: ByteString): ByteString


indexOf [jvm]
Content
@JvmOverloads()

fun indexOf(other: ByteString, fromIndex: Int):
@JvmOverloads()

open fun indexOf(other: ByteArray, fromIndex: Int):


lastIndexOf [jvm]
Content
@JvmOverloads()

fun lastIndexOf(other: ByteString, fromIndex: Int):
@JvmOverloads()

open fun lastIndexOf(other: ByteArray, fromIndex: Int):


md5 [jvm]
Content
fun md5(): ByteString


rangeEquals [jvm]
Content
open fun rangeEquals(offset: Int, other: ByteString, otherOffset: Int, byteCount: Int): Boolean
open fun rangeEquals(offset: Int, other: ByteArray, otherOffset: Int, byteCount: Int): Boolean


sha1 [jvm]
Content
fun sha1(): ByteString


sha256 [jvm]
Content
fun sha256(): ByteString


sha512 [jvm]
Content
fun sha512(): ByteString


startsWith [jvm]
Content
fun startsWith(prefix: ByteString):
fun startsWith(prefix: ByteArray):


string [jvm]
Brief description
Constructs a new String by decoding the bytes using charset.
Content
open fun string(charset: Charset): String


substring [jvm]
Content
@JvmOverloads()

open fun substring(beginIndex: Int, endIndex: Int): ByteString


toAsciiLowercase [jvm]
Content
open fun toAsciiLowercase(): ByteString


toAsciiUppercase [jvm]
Content
open fun toAsciiUppercase(): ByteString


toByteArray [jvm]
Content
open fun toByteArray():


toString [jvm]
Content
open override fun toString():


utf8 [jvm]
Content
open fun utf8(): String


write [jvm]
Brief description
Writes the contents of this byte string to out.
Content
open fun write(out: OutputStream)


Properties

Name Summary
size [jvm] val size: