@Immutable public class Base64 extends Object implements Serializable
Constructor and Description |
---|
Base64(String base64)
Creates a new Base64-encoded object.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decode()
Decodes this Base64 object to a byte array.
|
BigInteger |
decodeToBigInteger()
Decodes this Base64 object to an unsigned big integer.
|
String |
decodeToString()
Decodes this Base64 object to a string.
|
static Base64 |
encode(BigInteger bigInt)
Base64-encodes the specified big integer, without the sign bit.
|
static Base64 |
encode(byte[] bytes)
Base64-encodes the specified byte array.
|
static Base64 |
encode(String text)
Base64-encodes the specified string.
|
boolean |
equals(Object object)
Overrides
Object.equals() . |
static Base64 |
from(String base64)
Creates a new Base64-encoded object from the specified string.
|
int |
hashCode()
Overrides
Object.hashCode() . |
String |
toJSONString()
Returns a JSON string representation of this object.
|
String |
toString()
Returns a Base64 string representation of this object.
|
public byte[] decode()
public BigInteger decodeToBigInteger()
Same as new BigInteger(1, base64.decode())
.
public String decodeToString()
public String toJSONString()
public String toString()
public int hashCode()
Object.hashCode()
.public static Base64 from(String base64)
base64
- The Base64-encoded object value, null
if not specified.
The value is not validated for having characters from the
Base64 alphabet.null
if not specified.public static Base64 encode(byte[] bytes)
bytes
- The byte array to encode. Must not be null
.public static Base64 encode(BigInteger bigInt)
bigInt
- The big integer to encode. Must not be null
.Copyright © 2020 Connect2id Ltd.. All rights reserved.