public class Base64Util extends Object
| 构造器和说明 |
|---|
Base64Util() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decode(String encoded)
解码base64数据为octects
(Decodes Base64 data into octects)
|
static String |
encode(byte[] binaryData)
编码octects为Base64数据
(Encodes hex octects into Base64)
|
static String |
getBASE64(byte[] bytes)
base64位加密
|
static byte[] |
getFromBASE64(String str)
base64位解密
|
protected static boolean |
isBase64(char octect)
判断是否是base64加密数据
|
protected static boolean |
isData(char octect)
判断是否是-1
|
protected static boolean |
isPad(char octect)
判断是否是等号
|
protected static boolean |
isWhiteSpace(char octect)
判断是否是空格
|
static void |
main(String[] args)
加密测试方法
|
protected static int |
removeWhiteSpace(char[] data)
remove WhiteSpace from MIME containing encoded Base64 data.
|
public static byte[] decode(String encoded)
encoded - 包含Base64编码数据
(containing Base64 data)public static String encode(byte[] binaryData)
binaryData - 二进制数据数组(Array containing binaryData)public static String getBASE64(byte[] bytes)
bytes - 字符串子节数组public static byte[] getFromBASE64(String str)
str - 需要解密的base64为字符串protected static boolean isBase64(char octect)
octect - 加密的字符protected static boolean isData(char octect)
octect - 加密的字符protected static boolean isPad(char octect)
octect - protected static boolean isWhiteSpace(char octect)
octect - public static void main(String[] args)
args - 主方法形参protected static int removeWhiteSpace(char[] data)
data - the byte array of base64 data (with WS)Copyright © 2016. All rights reserved.