Uses of Class
okio.ByteString
-
Uses of ByteString in okio
Fields in okio declared as ByteStringModifier and TypeFieldDescriptionstatic final ByteString
ByteString.EMPTY
A singleton emptyByteString
.Methods in okio that return ByteStringModifier and TypeMethodDescriptionstatic ByteString
ByteString.decodeBase64
(String base64) Decodes the Base64-encoded bytes and returns their value as a byte string.static ByteString
Decodes the hex-encoded bytes and returns their value a byte string.static ByteString
ByteString.encodeString
(String s, Charset charset) Returns a new byte string containing thecharset
-encoded bytes ofs
.static ByteString
ByteString.encodeUtf8
(String s) Returns a new byte string containing theUTF-8
bytes ofs
.Options.get
(int i) final ByteString
HashingSink.hash()
Returns the hash of the bytes accepted thus far and resets the internal state of this sink.final ByteString
HashingSource.hash()
Returns the hash of the bytes supplied thus far and resets the internal state of this source.final ByteString
Buffer.hmacSha1
(ByteString key) Returns the 160-bit SHA-1 HMAC of this buffer.ByteString.hmacSha1
(ByteString key) Returns the 160-bit SHA-1 HMAC of this byte string.final ByteString
Buffer.hmacSha256
(ByteString key) Returns the 256-bit SHA-256 HMAC of this buffer.ByteString.hmacSha256
(ByteString key) Returns the 256-bit SHA-256 HMAC of this byte string.final ByteString
Buffer.hmacSha512
(ByteString key) Returns the 512-bit SHA-512 HMAC of this buffer.ByteString.hmacSha512
(ByteString key) Returns the 512-bit SHA-512 HMAC of this byte string.final ByteString
Buffer.md5()
Returns the 128-bit MD5 hash of this buffer.ByteString.md5()
Returns the 128-bit MD5 hash of this byte string.static ByteString
ByteString.of
(byte... data) Returns a new byte string containing a clone of the bytes ofdata
.static ByteString
ByteString.of
(byte[] data, int offset, int byteCount) Returns a new byte string containing a copy ofbyteCount
bytes ofdata
starting atoffset
.static ByteString
ByteString.of
(ByteBuffer data) static ByteString
ByteString.read
(InputStream in, int byteCount) Readscount
bytes fromin
and returns the result.Buffer.readByteString()
Buffer.readByteString
(long byteCount) BufferedSource.readByteString()
Removes all bytes bytes from this and returns them as a byte string.BufferedSource.readByteString
(long byteCount) RemovesbyteCount
bytes from this and returns them as a byte string.final ByteString
Buffer.sha1()
Returns the 160-bit SHA-1 hash of this buffer.ByteString.sha1()
Returns the 160-bit SHA-1 hash of this byte string.final ByteString
Buffer.sha256()
Returns the 256-bit SHA-256 hash of this buffer.ByteString.sha256()
Returns the 256-bit SHA-256 hash of this byte string.final ByteString
Buffer.sha512()
Returns the 512-bit SHA-512 hash of this buffer.ByteString.sha512()
Returns the 512-bit SHA-512 hash of this byte string.final ByteString
Buffer.snapshot()
Returns an immutable copy of this buffer as a byte string.final ByteString
Buffer.snapshot
(int byteCount) Returns an immutable copy of the firstbyteCount
bytes of this buffer as a byte string.ByteString.substring
(int beginIndex) Returns a byte string that is a substring of this byte string, beginning at the specified index until the end of this string.ByteString.substring
(int beginIndex, int endIndex) Returns a byte string that is a substring of this byte string, beginning at the specifiedbeginIndex
and ends at the specifiedendIndex
.ByteString.toAsciiLowercase()
Returns a byte string equal to this byte string, but with the bytes 'A' through 'Z' replaced with the corresponding byte in 'a' through 'z'.ByteString.toAsciiUppercase()
Returns a byte string equal to this byte string, but with the bytes 'a' through 'z' replaced with the corresponding byte in 'A' through 'Z'.Methods in okio with parameters of type ByteStringModifier and TypeMethodDescriptionint
ByteString.compareTo
(ByteString byteString) final boolean
ByteString.endsWith
(ByteString suffix) final ByteString
Buffer.hmacSha1
(ByteString key) Returns the 160-bit SHA-1 HMAC of this buffer.ByteString.hmacSha1
(ByteString key) Returns the 160-bit SHA-1 HMAC of this byte string.static HashingSink
HashingSink.hmacSha1
(Sink sink, ByteString key) Returns a sink that uses the obsolete SHA-1 HMAC algorithm to produce 160-bit hashes.static HashingSource
HashingSource.hmacSha1
(Source source, ByteString key) Returns a sink that uses the obsolete SHA-1 HMAC algorithm to produce 160-bit hashes.final ByteString
Buffer.hmacSha256
(ByteString key) Returns the 256-bit SHA-256 HMAC of this buffer.ByteString.hmacSha256
(ByteString key) Returns the 256-bit SHA-256 HMAC of this byte string.static HashingSink
HashingSink.hmacSha256
(Sink sink, ByteString key) Returns a sink that uses the SHA-256 HMAC algorithm to produce 256-bit hashes.static HashingSource
HashingSource.hmacSha256
(Source source, ByteString key) Returns a sink that uses the SHA-256 HMAC algorithm to produce 256-bit hashes.final ByteString
Buffer.hmacSha512
(ByteString key) Returns the 512-bit SHA-512 HMAC of this buffer.ByteString.hmacSha512
(ByteString key) Returns the 512-bit SHA-512 HMAC of this byte string.static HashingSink
HashingSink.hmacSha512
(Sink sink, ByteString key) Returns a sink that uses the SHA-512 HMAC algorithm to produce 512-bit hashes.long
Buffer.indexOf
(ByteString bytes) long
Buffer.indexOf
(ByteString bytes, long fromIndex) long
BufferedSource.indexOf
(ByteString bytes) Equivalent toindexOf(bytes, 0)
.long
BufferedSource.indexOf
(ByteString bytes, long fromIndex) Returns the index of the first match forbytes
in the buffer at or afterfromIndex
.final int
ByteString.indexOf
(ByteString other) final int
ByteString.indexOf
(ByteString other, int fromIndex) long
Buffer.indexOfElement
(ByteString targetBytes) long
Buffer.indexOfElement
(ByteString targetBytes, long fromIndex) long
BufferedSource.indexOfElement
(ByteString targetBytes) Equivalent toindexOfElement(targetBytes, 0)
.long
BufferedSource.indexOfElement
(ByteString targetBytes, long fromIndex) Returns the first index in this buffer that is at or afterfromIndex
and that contains any of the bytes intargetBytes
.final int
ByteString.lastIndexOf
(ByteString other) final int
ByteString.lastIndexOf
(ByteString other, int fromIndex) static Options
Options.of
(ByteString... byteStrings) boolean
Buffer.rangeEquals
(long offset, ByteString bytes) boolean
Buffer.rangeEquals
(long offset, ByteString bytes, int bytesOffset, int byteCount) boolean
BufferedSource.rangeEquals
(long offset, ByteString bytes) Returns true if the bytes atoffset
in this source equalbytes
.boolean
BufferedSource.rangeEquals
(long offset, ByteString bytes, int bytesOffset, int byteCount) Returns true ifbyteCount
bytes atoffset
in this source equalbytes
atbytesOffset
.boolean
ByteString.rangeEquals
(int offset, ByteString other, int otherOffset, int byteCount) Returns true if the bytes of this in[offset..offset+byteCount)
equal the bytes ofother
in[otherOffset..otherOffset+byteCount)
.final boolean
ByteString.startsWith
(ByteString prefix) Buffer.write
(ByteString byteString) BufferedSink.write
(ByteString byteString)