public class base64
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
Base64 |
private static java.lang.String |
Base64Url |
| Modifier | Constructor and Description |
|---|---|
private |
base64() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatString(byte[] b,
int lineLength,
java.lang.String prefix,
boolean addClose)
Formats data into a nicely formatted base64 encoded String
|
static byte[] |
fromString(java.lang.String str)
Convert a base64-encoded String to binary data
|
static java.lang.String |
toString(byte[] b)
Convert binary data to a base64-encoded String
|
static java.lang.String |
toString(byte[] b,
boolean useUrl)
Convert binary data to a base64-encoded String
|
private static final java.lang.String Base64
private static final java.lang.String Base64Url
public static java.lang.String toString(byte[] b)
b - An array containing binary datapublic static java.lang.String toString(byte[] b,
boolean useUrl)
b - An array containing binary datauseUrl - True to use Base64URL encoding (i.e. no trailing =, -_ instead of +/)public static java.lang.String formatString(byte[] b,
int lineLength,
java.lang.String prefix,
boolean addClose)
b - An array containing binary datalineLength - The number of characters per lineprefix - A string prefixing the characters on each lineaddClose - Whether to add a close parenthesis or notpublic static byte[] fromString(java.lang.String str)
str - A String containing the encoded data