List of utility methods to do File Copy
void | copyFile(File aSourceFile, File aTargetFile, boolean aAppend) copy File FileChannel inChannel = null; FileChannel outChannel = null; FileInputStream inStream = null; FileOutputStream outStream = null; try { inStream = new FileInputStream(aSourceFile); inChannel = inStream.getChannel(); outStream = new FileOutputStream(aTargetFile, aAppend); ... |
void | copyFile(File from, File to) copy File if (!from.exists()) { return; FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream(from); out = new FileOutputStream(to); ... |
String | CopyCacheFile(Context con, String assetsFile) Copy Cache File String out = getSdcardFilesDir(con) + assetsFile; copyTo(con, assetsFile, out); File f = new File(out); if (!f.exists()) { return null; return out; |
String | CopyFile(Context con, String assetsFile) Copy File String out = getDataFilesDir(con) + assetsFile; copyTo(con, assetsFile, out); File f = new File(out); if (!f.exists()) { return null; return out; |
void | copyFile(File from, File to) copy File if (!from.exists()) { return; FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream(from); out = new FileOutputStream(to); ... |
void | copyFile(File from, File to) copy File if (!from.exists()) { return; FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream(from); out = new FileOutputStream(to); ... |
void | copyFile(File sourceFile, File targetFile) copy File BufferedInputStream inBuff = null; BufferedOutputStream outBuff = null; if (null != sourceFile && null != targetFile) { try { inBuff = new BufferedInputStream(new FileInputStream( sourceFile)); outBuff = new BufferedOutputStream(new FileOutputStream( targetFile)); ... |
void | copyFile(String source, String dest) copy File File sourceFile = new File(source); File destFile = new File(dest); destFile.createNewFile(); InputStream in = new FileInputStream(sourceFile); OutputStream out = new FileOutputStream(destFile); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { ... |