Package com.yubico.webauthn.data
Class ByteArray
java.lang.Object
com.yubico.webauthn.data.ByteArray
- All Implemented Interfaces:
 Comparable<ByteArray>
An immutable byte array with support for encoding/decoding to/from various encodings.
- 
Constructor Summary
ConstructorsConstructorDescriptionByteArray(@lombok.NonNull byte[] bytes) Create a new instance by copying the contents ofbytes. - 
Method Summary
Modifier and TypeMethodDescriptionintbooleanstatic ByteArrayfromBase64(@NonNull String base64) Create a new instance by decodingbase64as classic Base64 data.static ByteArrayfromBase64Url(@NonNull String base64url) Create a new instance by decodingbase64urlas Base64Url data.static ByteArrayCreate a new instance by decodinghexas hexadecimal data.byte[]getBytes()getHex()inthashCode()booleanisEmpty()intsize()toString() 
- 
Constructor Details
- 
ByteArray
public ByteArray(@NonNull @lombok.NonNull byte[] bytes) Create a new instance by copying the contents ofbytes. 
 - 
 - 
Method Details
- 
fromBase64
Create a new instance by decodingbase64as classic Base64 data. - 
fromBase64Url
Create a new instance by decodingbase64urlas Base64Url data.- Throws:
 Base64UrlException- ifbase64urlis not valid Base64Url data.
 - 
fromHex
Create a new instance by decodinghexas hexadecimal data.- Throws:
 HexException- ifhexis not valid hexadecimal data.
 - 
concat
- Returns:
 - a new instance containing a copy of this instance followed by a copy of 
tail. 
 - 
isEmpty
public boolean isEmpty() - 
size
public int size() - 
getBytes
public byte[] getBytes()- Returns:
 - a copy of the raw byte contents.
 
 - 
getBase64
- Returns:
 - the content bytes encoded as classic Base64 data.
 
 - 
getBase64Url
- Returns:
 - the content bytes encoded as Base64Url data, without padding.
 
 - 
getHex
- Returns:
 - the content bytes encoded as hexadecimal data.
 
 - 
compareTo
- Specified by:
 compareToin interfaceComparable<ByteArray>
 - 
equals
 - 
hashCode
public int hashCode() - 
toString
 
 -