您的位置:首页 > 其它

assets目录文件复制到SD卡中

2014-05-22 18:12 190 查看
AssetManager am = context.getResources().getAssets();

InputStream iStream = null;

try {

iStream = am.open( "upload_app.png");

FileOutputStream fos = new FileOutputStream(Environment.getExternalStorageDirectory().getPath() + "/" + "upload_app.png");

byte[] buffer = new byte[1024]; //8192

int len;

while ((len = iStream.read(buffer)) > 0)

{

fos.write(buffer, 0, len);

}

fos.close();

iStream.close();

} catch (IOException e) {

e.printStackTrace();

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: