List of utility methods to do FileInputStream Copy
void | copyFile(File src, File dest) This method copies the content of a file (possibly directory) in another file. InputStream in = null; OutputStream out = null; if (dest.isDirectory()) dest = new File(dest, src.getName()); try { in = new FileInputStream(src); out = new FileOutputStream(dest); byte[] buf = new byte[1024]; ... |
void | copyFile(File src, File dest) copy File InputStream in = new FileInputStream(src); OutputStream out = new FileOutputStream(dest); try { writeInputToOutput(in, out, 8192); } finally { in.close(); out.close(); |
void | copyFile(File src, File dest) copy File copyFile(src, dest, null); |
void | copyFile(File src, File dest) copy File FileInputStream fIn = null; FileOutputStream fOut = null; try { fIn = new FileInputStream(src); fOut = new FileOutputStream(dest); copy(fIn, fOut); } finally { if (fIn != null) ... |
void | copyFile(File src, File dest, int bufSize) This method copies a file. byte[] buffer = new byte[bufSize]; InputStream in = null; OutputStream out = null; try { in = new FileInputStream(src); out = new FileOutputStream(dest); while (true) { int read = in.read(buffer); ... |
void | copyFile(File src, File dst) Copies src file to dst file. OutputStream out = null; InputStream in = new FileInputStream(src); try { String dstAbsPath = dst.getAbsolutePath(); String dstDir = dstAbsPath.substring(0, dstAbsPath.lastIndexOf(File.separator)); File dir = new File(dstDir); if (!dir.exists() && !dir.mkdirs()) { throw new IOException("Fail to create the directory: " + dir.getAbsolutePath()); ... |
boolean | copyFile(File src, File dst) copy File try { InputStream in = new FileInputStream(src); OutputStream out = new FileOutputStream(dst); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); in.close(); out.close(); return true; } catch (Exception e) { return false; |
void | copyFile(File src, File dst) copy File InputStream in = new FileInputStream(src); OutputStream out = new FileOutputStream(dst); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); in.close(); ... |
void | copyFile(File src, File dst) Copy a file. copyOrAppend(src, dst, false); |
void | copyFile(File src, File dst) copy File try { FileInputStream in = null; FileOutputStream out = null; try { out = new FileOutputStream(dst); in = new FileInputStream(src); byte[] buffer = new byte[1024]; int len = 0; ... |