package com.angding.util;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;/** * @author 邓孟鑫  */public class FileUtils {public static boolean fileCopy(String oldFilePath,String newFilePath) throws IOException {//如果原文件不存在if(fileExists(oldFilePath) == false){return false;}//获得原文件流FileInputStream inputStream = new FileInputStream(new File(oldFilePath));byte[] data = new byte[1024];//输出流FileOutputStream outputStream =new FileOutputStream(new File(newFilePath));//开始处理流while (inputStream.read(data) != -1) {outputStream.write(data);}inputStream.close();outputStream.close();return true;}public static boolean fileExists(String filePath) {File file = new File(filePath);return file.exists();}}


好了就到这里,如果以上代码存在问题请将您宝贵的意见提出来,非常感谢

更多相关文章

  1. ch026 Android(安卓)Socket
  2. Android中使用log4j
  3. 2011.07.11(3)——— android xliff字符串操作
  4. 2011.07.11(3)——— android xliff字符串操作
  5. Android中使用log4j
  6. Android官方ORM数据库Room技术解决方案简介(一)
  7. 如何解析 android 中的 XML?
  8. android 日志文件输出
  9. Android通过http协议POST传输方式(输出流提交到服务端)

随机推荐

  1. Android界面开发简介
  2. 在 Android(安卓)字符串资源中直接使用 E
  3. Android中Shape和Selector的结合使用。
  4. Android(安卓)build.gradle配置buildConf
  5. 开发具备语音识别功能的 Android* 应用
  6. Android介绍
  7. Android XML解析学习——Sax方式(续)
  8. Android(安卓)studio断点调试(全在这里)
  9. Android Animation学习笔记
  10. Android在Eclipse环境下安装配置