Android(安卓)解压zip文件
16lz
2021-12-04
这两天研究了一下android下的解压所技术,略有所获,下面是解压缩的操作方法。
private void unZipMapCache(){ try { InputStream is = this.getAssets().open(ASSETS_NAME);ZipInputStream zis= new ZipInputStream(is);ZipEntry entry = null;while((entry = zis.getNextEntry()) != null){File file = new File("/mnt/sdcard/",entry.getName());if(entry.isDirectory()){file.mkdirs();continue;}else{file.createNewFile(); OutputStream myOutput = new FileOutputStream(file); byte[] buffer = new byte[1024]; int count; while ((count = zis.read(buffer)) != -1) { myOutput.write(buffer, 0, count); } myOutput.close();}}zis.close();is.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}
更多相关文章
- Android(安卓)Zip压缩解压缩
- 【转】Launcher研究之AndroidManifest.xml分析
- 2011.06.03(2)——— android 1.6 launcher研究之自定义ViewGroup
- 2011.06.03(2)——— android 1.6 launcher研究之自定义ViewGroup
- Android(安卓)APK反编译
- Android(安卓)arm linux kernel启动流程
- android sdk MyEclipse adt 配置与开发 -windows
- android sdk配置
- android Application Component研究之BroadcastReceiver