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
Properties
Functions
Returns a ByteBuffer
view of the bytes in this ByteString
.
Copies bytes of this in [offset..offset+byteCount]
to other in [targetOffset..targetOffset+byteCount]
.
Returns the 160-bit SHA-1 HMAC of this byte string.
Returns the 160-bit SHA-1 HMAC of this byte string.
Returns the 160-bit SHA-1 HMAC of this byte string.
Returns the 160-bit SHA-1 HMAC of this byte string.
Returns the 256-bit SHA-256 HMAC of this byte string.
Returns the 256-bit SHA-256 HMAC of this byte string.
Returns the 256-bit SHA-256 HMAC of this byte string.
Returns the 256-bit SHA-256 HMAC of this byte string.
Returns the 512-bit SHA-512 HMAC of this byte string.
Returns the 512-bit SHA-512 HMAC of this byte string.
Returns the 512-bit SHA-512 HMAC of this byte string.
Returns the 512-bit SHA-512 HMAC of this byte string.
Returns the 128-bit MD5 hash of this byte string.
Returns true if the bytes of this in [offset..offset+byteCount)
equal the bytes of other
in [otherOffset..otherOffset+byteCount)
. Returns false if either range is out of bounds.
Returns the 160-bit SHA-1 hash of this byte string.
Returns the 256-bit SHA-256 hash of this byte string.
Returns the 512-bit SHA-512 hash of this byte string.
Returns a byte string that is a substring of this byte string, beginning at the specified beginIndex
and ends at the specified endIndex
. Returns this byte string if beginIndex
is 0 and endIndex
is the length of this byte string.
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'. Returns this byte string if it contains no bytes in 'A' through 'Z'.
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'. Returns this byte string if it contains no bytes in 'a' through 'z'.
Returns a byte array containing a copy of the bytes in this ByteString
.
Returns a human-readable string that describes the contents of this byte string. Typically this is a string like [text=Hello]
or [hex=0000ffff]
.
Returns a human-readable string that describes the contents of this byte string. Typically this is a string like [text=Hello]
or [hex=0000ffff]
.
Writes the contents of this byte string to out
.