gnu.crypto.util
Class Base64
public class Base64
extends java.lang.Object
Most of this implementation is from Robert Harder's public domain Base64
code (version 1.4.1 available from <http://iharder.net/xmlizable>).
Version:
static byte[] | decode(String s) - Decodes data from Base64 notation.
|
static byte[] | decode(byte[] src, int off, int len) - Decodes Base64 content in byte array format and returns the decoded byte
array.
|
static String | encode(byte[] src) - Encodes a byte array into Base64 notation.
|
static String | encode(byte[] src, int off, int len, boolean breakLines) - Encodes a byte array into Base64 notation.
|
decode
public static final byte[] decode(String s)
throws UnsupportedEncodingException
Decodes data from Base64 notation.
s
- the string to decode.
- the decoded data.
decode
public static byte[] decode(byte[] src,
int off,
int len)
Decodes Base64 content in byte array format and returns the decoded byte
array.
src
- the Base64 encoded data.off
- the offset of where to begin decoding.len
- the length of characters to decode.
- the decoded data.
encode
public static final String encode(byte[] src)
Encodes a byte array into Base64 notation. Equivalent to calling
encode(source, 0, source.length)
.
src
- the data to convert.
encode
public static final String encode(byte[] src,
int off,
int len,
boolean breakLines)
Encodes a byte array into Base64 notation.
src
- the data to convert.off
- offset in array where conversion should begin.len
- length of data to convert.breakLines
- break lines at 80 characters or less.
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.