public static byte[] decode(byte[] base64Data)
{
if(base64Data==null)
return null;
if(base64Data.length==0)
return new byte[0];
if(base64Data.length%4 !=0)
throw new IllegalArgumentException("数据不完整,长度为:"+base64Data.length);
byte[] result=null;
int groupCount = base64Data.length/4;
int lastData = base64Data.length;
while(base64Data[lastData-1] == 0x3D)
{
if(--lastData == 0)
return new byte[0];
}
result = new byte[lastData-groupCount];