public class Base64Coder
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
CHARSET_UTF8 |
构造器和说明 |
---|
Base64Coder() |
限定符和类型 | 方法和说明 |
---|---|
static byte[] |
decode(char[] in)
Decodes a byte array from Base64 format.
|
static byte[] |
decode(java.lang.String s)
Decodes a byte array from Base64 format.
|
static java.lang.String |
decodeString(java.lang.String s)
Decodes a string from Base64 format.
|
static char[] |
encode(byte[] in)
Encodes a byte array into Base64 format.
|
static char[] |
encode(byte[] in,
int iLen)
Encodes a byte array into Base64 format.
|
static java.lang.String |
encodeString(java.lang.String s)
Encodes a string into Base64 format.
|
public static final java.lang.String CHARSET_UTF8
public static java.lang.String encodeString(java.lang.String s)
s
- a String to be encoded.public static char[] encode(byte[] in)
in
- an array containing the data bytes to be encoded.public static char[] encode(byte[] in, int iLen)
in
- an array containing the data bytes to be encoded.iLen
- number of bytes to process in in
.public static java.lang.String decodeString(java.lang.String s)
s
- a Base64 String to be decoded.java.lang.IllegalArgumentException
- if the input is not valid Base64 encoded data.public static byte[] decode(java.lang.String s)
s
- a Base64 String to be decoded.java.lang.IllegalArgumentException
- if the input is not valid Base64 encoded data.public static byte[] decode(char[] in)
in
- a character array containing the Base64 encoded data.java.lang.IllegalArgumentException
- if the input is not valid Base64 encoded data.