public final class ByteArray extends java.lang.Object implements java.lang.Comparable<ByteArray>, com.yubico.internal.util.json.JsonStringSerializable
Constructor and Description |
---|
ByteArray(@NonNull byte[] bytes)
Create a new instance by copying the contents of
bytes . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ByteArray other) |
ByteArray |
concat(@NonNull ByteArray tail) |
boolean |
equals(java.lang.Object o) |
static ByteArray |
fromBase64(@NonNull java.lang.String base64)
Create a new instance by decoding
base64 as classic Base64 data. |
static ByteArray |
fromBase64Url(@NonNull java.lang.String base64)
Create a new instance by decoding
base64 as Base64Url data. |
static ByteArray |
fromHex(@NonNull java.lang.String hex)
Create a new instance by decoding
hex as hexadecimal data. |
java.lang.String |
getBase64() |
java.lang.String |
getBase64Url() |
byte[] |
getBytes() |
java.lang.String |
getHex() |
int |
hashCode() |
boolean |
isEmpty() |
int |
size() |
java.lang.String |
toJsonString()
Used by JSON serializer.
|
java.lang.String |
toString() |
public ByteArray(@NonNull @NonNull byte[] bytes)
bytes
.public static ByteArray fromBase64(@NonNull @NonNull java.lang.String base64)
base64
as classic Base64 data.public static ByteArray fromBase64Url(@NonNull @NonNull java.lang.String base64) throws Base64UrlException
base64
as Base64Url data.Base64UrlException
- if base64
is not valid Base64Url data.public static ByteArray fromHex(@NonNull @NonNull java.lang.String hex) throws HexException
hex
as hexadecimal data.HexException
- if hex
is not valid hexadecimal data.public ByteArray concat(@NonNull @NonNull ByteArray tail)
tail
.public boolean isEmpty()
public int size()
public byte[] getBytes()
public java.lang.String getBase64()
public java.lang.String getBase64Url()
public java.lang.String getHex()
public java.lang.String toJsonString()
toJsonString
in interface com.yubico.internal.util.json.JsonStringSerializable
public int compareTo(ByteArray other)
compareTo
in interface java.lang.Comparable<ByteArray>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object