Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
encDefault
"base64": RFC 2045 default encoding
|
private static java.lang.String |
encUrlSafe
"base64url": RFC 4648 url-safe encoding
|
Modifier | Constructor and Description |
---|---|
private |
Base64() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
encode(java.nio.ByteBuffer s)
Encodes all remaining bytes from the specified byte buffer into a new string using the Base64 default encoding scheme.
|
static java.lang.String |
encode(java.nio.ByteBuffer s,
boolean urlsafe)
Encodes all remaining bytes from the specified byte buffer into a new string using a supported Base64 encoding scheme.
|
static java.lang.String |
encode(java.lang.String s)
Encodes all characters from the specified string into a new String using the Base64 default encoding scheme.
|
static java.lang.String |
encode(java.lang.String s,
boolean urlsafe)
Encodes all characters from the specified string into a new String using a supported Base64 encoding scheme.
|
private static java.lang.String encDefault
private static java.lang.String encUrlSafe
private Base64()
public static java.lang.String encode(java.lang.String s)
s
- the string to encodepublic static java.lang.String encode(java.lang.String s, boolean urlsafe)
s
- the string to encodeurlsafe
- if true
, uses "base64url" encoding, otherwise use the "base64" default encodingpublic static java.lang.String encode(java.nio.ByteBuffer s)
s
- the source ByteBuffer to encodepublic static java.lang.String encode(java.nio.ByteBuffer s, boolean urlsafe)
s
- the source ByteBuffer to encodeurlsafe
- if true
, uses "base64url" encoding, otherwise use the "base64" default encoding