zr.zrpower.common.util
类 Base64

java.lang.Object
  继承者 zr.zrpower.common.util.Base64

public final class Base64
extends java.lang.Object


方法摘要
static byte[] decode(char[] arg)
          返回用BASE64编码后字符数组的字节数组
static byte[] decode(char[] value, int startIndex, int endIndex)
          返回用BASE64编码后字符数组的字节数组 如果有非法的Base64编码字符,截断到[0, 0x7F];如果还不合法的话,使用缺省字符'/'代替, 也就是认为原始的6个二进制位是x03F
static byte[] decode(java.lang.String arg)
          返回BASE64字符串表示的字节数组
static char[] encode(byte[] arg)
          返回字节数组用BASE64格式编码的字符数组,不添加CR/LF等字符
static char[] encode(byte[] value, int startIndex, int endIndex)
          返回Base64编码字符数组,后面可能有填充字符'='
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

encode

public static final char[] encode(byte[] arg)
返回字节数组用BASE64格式编码的字符数组,不添加CR/LF等字符

参数:
arg - 字节数组
返回:
字符数组

decode

public static final byte[] decode(java.lang.String arg)
返回BASE64字符串表示的字节数组

参数:
arg - BASE64字符串
返回:
字节数组

decode

public static final byte[] decode(char[] arg)
返回用BASE64编码后字符数组的字节数组

参数:
arg - 字符数组
返回:
字节数组

encode

public static char[] encode(byte[] value,
                            int startIndex,
                            int endIndex)
返回Base64编码字符数组,后面可能有填充字符'='

参数:
value - 字节数组
startIndex - 开始索引(包含)
endIndex - 结束索引(不包含)
返回:
字符数组

decode

public static byte[] decode(char[] value,
                            int startIndex,
                            int endIndex)
返回用BASE64编码后字符数组的字节数组

如果有非法的Base64编码字符,截断到[0, 0x7F];如果还不合法的话,使用缺省字符'/'代替, 也就是认为原始的6个二进制位是x03F

参数:
value - 字符数组
startIndex - 开始索引(包含)
endIndex - 结束索引(不包含)
返回:
字节数组