import ;
import ;
import ;
import ;
import ;
import ;
import ;
import .BASE64Encoder;
/**
* 将音频转化为base64位编码* */
@ResponseBody
@RequestMapping(value="tobase",method=)
public String tobase64(String url){
try{
URL urlfile=new URL(url);
// 下载网络文件
int bytesum = 0;
int byteread = 0;
URLConnection conn = ();
InputStream inStream = ();
int size=();
byte[] buffer = new byte[size];
while ((byteread = (buffer)) != -1) {
(buffer);
();
String str=new BASE64Encoder().encode(buffer);
if(str!=null){
str=((""),"");
str=("=", "");
str=(" ", "");
}
return str;
}
}catch(Exception e){
();
}
return null;
}