工具类:
public static void SaveFileFromInputStream(InputStream stream,String path,String filename) throws IOException {
FileOutputStream fs=new FileOutputStream( path + "/"+ filename);
byte[] buffer =new byte[1024*1024];
int bytesum = 0;
int byteread = 0;
while ((byteread=stream.read(buffer))!=-1)
{
bytesum+=byteread;
fs.write(buffer,0,byteread);
fs.flush();
}
fs.close();
stream.close();
}
public static byte[] readFile(File f_file) throws Exception{
InputStream is = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
is = new FileInputStream(f_file);// pathStr 文件路径
byte[] b = new byte[1024];
int n;
while ((n = is.read(b)