public class Base64 extends Object
Change Log:
I am placing this code in the Public Domain. Do with it as you will. This software comes with no guarantees or warranties but with plenty of well-wishing instead! Please visit http://iharder.net/base64 periodically to check for updates or to contribute improvements.
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(byte[] source)
Very low-level access to decoding ASCII characters in the form of a byte
array.
|
static byte[] |
decode(String s)
Decodes data from Base64 notation, automatically detecting
gzip-compressed data and decompressing it.
|
static String |
encodeBytes(byte[] source)
Encodes a byte array into Base64 notation.
|
public static String encodeBytes(byte[] source)
Valid options:
GZIP: gzip-compresses object before encoding it.
DONT_BREAK_LINES: don't break lines at 76 characters
<i>Note: Technically, this makes your encoding non-compliant.</i>
Example: encodeBytes( myData, Base64.GZIP ) or
Example:
encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )
source - The data to convertpublic static byte[] decode(byte[] source)
source - The Base64 encoded datapublic static byte[] decode(String s)
s - the string to decodeCopyright © 2014 Quattor. All Rights Reserved.