您的位置:首页 > 移动开发 > Android开发

Android Dev Intro - Binary File Read Write

2016-05-25 15:14 471 查看
File fl = new File("/sdcard/420p.yuv");

try {
mInputStream  = new FileInputStream(fl);

} catch(Exception ex) {}

try {
ret = mInputStream.read(mDecodeBuffer);
if(ret != mDecodeBuffer.length) {
try {
mInputStream.close();
File fl = new File("/sdcard/420p.yuv");
mInputStream = new FileInputStream(fl);
ret = mInputStream.read(mDecodeBuffer);
} catch(Exception ex) {}
}

}

catch(Exception ex) {}

File fl = new File("/sdcard/t1.h264");
try {
fos = new FileOutputStream(fl);
}catch (Exception ex) {

}

try {
fos.write(videoConfigBuf, 0, videoConfigBuf.length);
}catch(Exception ex) {}

try {
fos.write(mvf.mBuffer, mvf.mInfo.offset, mvf.mInfo.size);
}catch(Exception ex) {}

try {
fos.flush();
}catch (Exception ex) {}
try {
fos.close();
} catch (Exception ex) {}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: