FileInputStream read文件后 文件清零怎办?
如下函数,读取文件后,文件变成0B,怎么会这样,怎么破?
//以字节流读取文件*/
public byte[] getByteStream(){
try{
File file = new File(mCurrentFilePath);
// 拿到输入流
FileInputStream input = new FileInputStream(file);
// 建立存储器
byte[] buf =new byte[input.available()];
// 读取到存储器
input.read(buf);
input.close();// 关闭输入流
// 返回数据
return buf;
}catch(Exception e){
e.printStackTrace();
}
return null;
}