private void copyAssetToSdcard(String fromFileName,
String toFileName) {
File file = new File(MM.getSDPath() + toFileName);
file.getParentFile().mkdirs();
if (file.exists())
return;
InputStream in;
OutputStream out;
try {
in = getAssets().open(fromFileName);
out = new FileOutputStream(file);
byte[] buff = new byte[1024];
int len;
while ((len = in.read(buff)) > 0) {
out.write(buff, 0, len);
}
out.close();
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Copy asset to sdcard
最新推荐文章于 2022-06-16 19:21:17 发布