com.baidu.sapi2.security
类 Base64

java.lang.Object
  继承者 com.baidu.sapi2.security.Base64

public class Base64
extends Object

编码处理类

作者:
sunweili

构造方法摘要
Base64()
           
 
方法摘要
static int decode(char c, int key)
           
static byte[] decode(String s)
          把一个进行base64编码的字符串进行解码还原成byte数组
static void decode(String s, ByteArrayOutputStream bos)
           
static String encode(byte[] data)
          把byte数组进行base64编码,变成字符串
static StringBuffer encode(byte[] data, int start, int len, StringBuffer buf)
          Encodes the part of the given byte array denoted by start and len to the Base64 format.
static boolean needBase64(String s)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Base64

public Base64()
方法详细信息

encode

public static String encode(byte[] data)
把byte数组进行base64编码,变成字符串

参数:
data - byte数组
返回:

encode

public static StringBuffer encode(byte[] data,
                                  int start,
                                  int len,
                                  StringBuffer buf)
Encodes the part of the given byte array denoted by start and len to the Base64 format. The encoded data is appended to the given StringBuffer. If no StringBuffer is given, a new one is created automatically. The StringBuffer is the return value of this method.


decode

public static int decode(char c,
                         int key)

decode

public static byte[] decode(String s)
把一个进行base64编码的字符串进行解码还原成byte数组

参数:
s - 已经经过base64编码的字符串
返回:

decode

public static void decode(String s,
                          ByteArrayOutputStream bos)

needBase64

public static boolean needBase64(String s)


Copyright © 2013. All Rights Reserved.