org.metastatic.jessie

Class Base64


public final class Base64
extends java.lang.Object

Method Summary

static byte[]
decode(String b64)
Decode a Base-64 string into a byte array.
static String
encode(byte[] buf, int tw)
Base64 encode a byte array, returning the returning string.

Method Details

decode

public static byte[] decode(String b64)
            throws IOException
Decode a Base-64 string into a byte array.
Parameters:
b64 - The Base-64 encoded string.
Returns:
The decoded bytes.

encode

public static String encode(byte[] buf,
                            int tw)
Base64 encode a byte array, returning the returning string.
Parameters:
buf - The byte array to encode.
tw - The total length of any line, 0 for unlimited.
Returns:
buf encoded in Base64.