当前位置: 首页 > news >正文

现在企业需要建设网站吗几个做ppt的网站知乎

现在企业需要建设网站吗,几个做ppt的网站知乎,杭州设计公司logo,沈阳世纪兴网站建设可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效#xff0c;请关闭广告屏蔽插件后再试):问题:I put a zip file in the android assets. How do i extract the file in the android internal storage? I know how to get the file, but i dont know how t…可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效请关闭广告屏蔽插件后再试):问题:I put a zip file in the android assets. How do i extract the file in the android internal storage? I know how to get the file, but i dont know how to extract it. This is my code..Util zip ;zip new Util();zip.copyFileFromAsset(this, myfile.zip, getExternalStorage()/android/data/edu.binus.profile/);Thanks for helping :D回答1:This piece of code will help you....Just pass the zipfile location and the location where you want the extracted files to be saved to this class while making an object...and call unzip method...public class Decompress {private String zip;private String loc;public Decompress(String zipFile, String location) {zip zipFile;loc location;dirChecker();}public void unzip() {try {FileInputStream fin new FileInputStream(zip);ZipInputStream zin new ZipInputStream(fin);ZipEntry ze null;while ((ze zin.getNextEntry()) ! null) {Log.v(Decompress, Unzipping ze.getName());if(ze.isDirectory()) {dirChecker(ze.getName());} else {FileOutputStream fout new FileOutputStream(loc ze.getName());for (int c zin.read(); c ! -1; c zin.read()) {fout.write(c);}zin.closeEntry();fout.close();}}zin.close();} catch(Exception e) {Log.e(Decompress, unzip, e);}}private void dirChecker(String dir) {File f new File(_location dir);if(!f.isDirectory()) {f.mkdirs();}}}回答2:Based on Sreedev R solution,I added the option to read the file from assets and use buffer:package com.pixoneye.api.utils;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.util.zip.ZipEntry;import java.util.zip.ZipInputStream;import android.content.Context;import android.util.Log;public class Decompress {private static final int BUFFER_SIZE 1024 * 10;private static final String TAG Decompress;public static void unzipFromAssets(Context context, String zipFile, String destination) {try {if (destination null || destination.length() 0)destination context.getFilesDir().getAbsolutePath();InputStream stream context.getAssets().open(zipFile);unzip(stream, destination);} catch (IOException e) {e.printStackTrace();}}public static void unzip(String zipFile, String location) {try {FileInputStream fin new FileInputStream(zipFile);unzip(fin, location);} catch (FileNotFoundException e) {e.printStackTrace();}}public static void unzip(InputStream stream, String destination) {dirChecker(destination, );byte[] buffer new byte[BUFFER_SIZE];try {ZipInputStream zin new ZipInputStream(stream);ZipEntry ze null;while ((ze zin.getNextEntry()) ! null) {Log.v(TAG, Unzipping ze.getName());if (ze.isDirectory()) {dirChecker(destination, ze.getName());} else {File f new File(destination, ze.getName());if (!f.exists()) {boolean success f.createNewFile();if (!success) {Log.w(TAG, Failed to create file f.getName());continue;}FileOutputStream fout new FileOutputStream(f);int count;while ((count zin.read(buffer)) ! -1) {fout.write(buffer, 0, count);}zin.closeEntry();fout.close();}}}zin.close();} catch (Exception e) {Log.e(TAG, unzip, e);}}private static void dirChecker(String destination, String dir) {File f new File(destination, dir);if (!f.isDirectory()) {boolean success f.mkdirs();if (!success) {Log.w(TAG, Failed to create folder f.getName());}}}}回答3:Maybe you should try using a FileOutputStream in combination with an inputstream from the zip file. With a package file, this should work.To quote wordy from this question:PackageManager pm context.getPackageManager();String apkFile pm.getApplicationInfo(context.getPackageName(), 0).sourceDir;ZipFile zipFile new ZipFile(apkFile);ZipEntry entry zipFile.getEntry(assets/FILENAME);myInput zipFile.getInputStream(entry);myOutput new FileOutputStream(file);byte[] buffer new byte[1024*4];int length;int total 0;int counter 1;while ((length myInput.read(buffer)) 0) {total length;counter;if (counter % 32 0) {publishProgress(total);}myOutput.write(buffer, 0, length);}Looks like there may be problems with ProGuard but hopefully the code sample works for you.回答4:I havent tested yet,but while doing a project on OCR I came across this library,where there is method of unzipping a downloaded file from the net. The exact method for unzipping file is installZipFromAssets(String sourceFilename,File destinationDir,File destinationFile) found under this class.Hope this is what you are looking for回答5:You can also make use of the zip4j external library that provides additional features like encryption. Also, it has functions to extract files to a particular location provided the path.
http://www.huolong8.cn/news/470125/

相关文章:

  • 做汽车销售要了解的网站个人网站怎么做app
  • 有哪些网站可以做任务建设的比较好的档案馆网站
  • 网站建设补贴内蒙古网站制作公司
  • 铁岭做网站公司哪家好网店装修素材
  • 北京怎样建网站phpcms校园网站
  • 怎样在工商局网站做申请登记电子商务网站设计与维护
  • 在上海做兼职在哪个网站兰州网络推广新手
  • 衡阳市建设学校官方网站网站栏目排序
  • 这么制作自己的网站企业 北京 响应式网站
  • 优仔电话手表网站长沙模板建网站需要多久
  • 昆明做网站竞价河北建筑工程学院招生网官网
  • 沈阳海外模板建站本地网站建设官网
  • 网站建设管理系统查看一个网站的源代码做评价
  • 高端企业网站报价深圳网站设计优异刻
  • 低代码网站开发平台vs 2010 网站建设
  • 福州品牌网站建设oemgoogle权重查询
  • 安庆网站建设公司网站界面需求
  • 网站开发团队人员构成wordpress首页导航代码
  • 学习网站建设建议调查问卷网上购物都有哪些平台
  • 网页设计怎么建站点个人网页设计与实现ppt
  • 做网站需要什么服务器wordpress区块链模板
  • 做网站公司大型餐厅网站建设
  • 建立公司网站关键词排名优化网站建设公司
  • 网站建设大作业论文高端网站设计哪里比较好
  • 3d网站怎么做网站建设条件
  • 水果建设网站前的市场分析wordpress手机网站插件
  • 白石洲附近做网站公司前端开发是做什么
  • 网站悬浮代码上海建设电动车官方网站
  • 做手机网站图品汇免费素材网
  • 如何建微信商城网站漯河装修公司网站建设