public static void copyFileFromAssetsToSDCard() throws Throwable {
InputStream inStream = this.getAssets().open("hello.zip");
String filePath = android.os.Environment.getExternalStorageDirectory()
.getAbsolutePath() + "/" + "hello.zip";
OutputStream outStream = new FileOutputStream(filePath);
byte[] buffer = new byte[1024];
int length = inStream.read(buffer);
outStream.write(buffer, 0, length);
outStream.flush();
inStream.close();
outStream.close();
}
android从assets目录复制到sd卡
最新推荐文章于 2021-05-24 19:18:29 发布