public class Base64
extends java.lang.Object
Encoding supports two modes - with or without line separator. When line separator flag is on, result will have lines with max size of 76 chars, as per spec.
When decoding, input must be valid, without illegal characters. If input contains lines, they must be 76 chars long. Lines must end with CRLF ("\r\n"), as per spec.
Modifier and Type | Field and Description |
---|---|
static char[] |
CHARS |
Constructor and Description |
---|
Base64() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(byte[] arr)
Decodes BASE64 encoded byte array.
|
static byte[] |
decode(char[] arr)
Decodes a BASE64 encoded char array.
|
static byte[] |
decode(java.lang.String s)
Decodes a BASE64 encoded string.
|
static java.lang.String |
decodeToString(byte[] arr) |
static java.lang.String |
decodeToString(java.lang.String s) |
static byte[] |
encodeToByte(byte[] arr) |
static byte[] |
encodeToByte(byte[] arr,
boolean lineSep)
Encodes a raw byte array into a BASE64
char[] . |
static byte[] |
encodeToByte(java.lang.String s) |
static byte[] |
encodeToByte(java.lang.String s,
boolean lineSep) |
static char[] |
encodeToChar(byte[] arr,
boolean lineSeparator)
Encodes a raw byte array into a BASE64
char[] . |
static java.lang.String |
encodeToString(byte[] arr) |
static java.lang.String |
encodeToString(byte[] arr,
boolean lineSep)
Encodes a raw byte array into a BASE64
String . |
static java.lang.String |
encodeToString(java.lang.String s) |
static java.lang.String |
encodeToString(java.lang.String s,
boolean lineSep) |
public static char[] encodeToChar(byte[] arr, boolean lineSeparator)
char[]
.lineSeparator
- optional CRLF after 76 chars, unless EOF.public static byte[] decode(char[] arr)
public static byte[] encodeToByte(java.lang.String s)
public static byte[] encodeToByte(java.lang.String s, boolean lineSep)
public static byte[] encodeToByte(byte[] arr)
public static byte[] encodeToByte(byte[] arr, boolean lineSep)
char[]
.lineSep
- optional CRLF after 76 chars, unless EOF.public static java.lang.String decodeToString(byte[] arr)
public static byte[] decode(byte[] arr)
public static java.lang.String encodeToString(java.lang.String s)
public static java.lang.String encodeToString(java.lang.String s, boolean lineSep)
public static java.lang.String encodeToString(byte[] arr)
public static java.lang.String encodeToString(byte[] arr, boolean lineSep)
String
.public static java.lang.String decodeToString(java.lang.String s)
public static byte[] decode(java.lang.String s)
Copyright © 2003-present Jodd Team