public final class Base64 extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(String b64)
Decode a Base-64 string into a byte array.
|
static String |
encode(byte[] buf)
Base64 encode a byte array, with no line wrapping.
|
static String |
encode(byte[] buf,
int tw)
Base64 encode a byte array, returning the returning string.
|
static String |
encode(byte[] buf,
int offset,
int length,
int tw)
Base64 encode a byte array, returning the returning string.
|
public static byte[] decode(String b64) throws IOException
b64
- The Base-64 encoded string.IOException
- If the argument is not a valid Base-64
encoding.public static String encode(byte[] buf)
buf
- The byte array to encode.public static String encode(byte[] buf, int tw)
buf
- The byte array to encode.tw
- The total length of any line, 0 for unlimited.public static String encode(byte[] buf, int offset, int length, int tw)
buf
- The byte array to encode.offset
- The offset in the byte array to start.length
- The number of bytes to encode.tw
- The total length of any line, 0 for unlimited.