List of utility methods to do FileInputStream Copy
void | copyFile(File srcFile, File destFile) copy File if (srcFile.equals(destFile)) { return; copyStream(new FileInputStream(srcFile), new FileOutputStream(destFile)); |
void | copyFile(File srcFile, File destFile) Copy a file preserving the date. if (destFile.exists() && destFile.isDirectory()) { throw new IOException("Destination '" + destFile + "' exists but is a directory"); FileInputStream input = new FileInputStream(srcFile); try { FileOutputStream output = new FileOutputStream(destFile); try { copy(input, output); ... |
void | copyFile(File srcFile, File destFile, boolean recursive) copy File if (recursive) { if (!destFile.isDirectory()) { throw new IOException("Destination must be a directory."); copyFileR(srcFile, destFile); } else { copyFile(srcFile, destFile); |
void | copyFile(File srcFile, File dstFile) copy File FileInputStream src = new FileInputStream(srcFile); try { copyFile(src, dstFile); } finally { src.close(); |
void | copyFile(File srcFile, File dstFile) copy File byte[] buf = new byte[1024]; OutputStream ostream = new FileOutputStream(dstFile); InputStream istream = new FileInputStream(srcFile); try { int numBytes = 0; while ((numBytes = istream.read(buf)) >= 0) { ostream.write(buf, 0, numBytes); } finally { ostream.close(); |
void | copyFile(File srcFile, File dstFile) Copia de ficheros InputStream in = null; OutputStream out = null; try { in = new FileInputStream(srcFile); out = new FileOutputStream(dstFile); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { ... |
void | copyFile(File srcFile, File dstFile) copy File dstFile.getParentFile().mkdirs(); FileInputStream input = null; FileOutputStream output = null; try { input = new FileInputStream(srcFile); output = new FileOutputStream(dstFile); int bufferSize = 1024; byte[] buffer = new byte[bufferSize]; ... |
void | copyFile(File srcPath, File dstPath) copy File InputStream in = new FileInputStream(srcPath); OutputStream out = new FileOutputStream(dstPath); copy(in, out); in.close(); out.close(); |
void | copyfile(File srFile, File dtFile) copyfile InputStream in = new FileInputStream(srFile); File desDir = dtFile.getParentFile(); if (!desDir.exists()) { boolean ret = desDir.mkdirs(); if (!ret) throw new IOException("Cannot create directory " + desDir.getName()); OutputStream out = new FileOutputStream(dtFile); ... |
void | copyFile(File target, File source) Copies a file. FileInputStream in = null; try { in = new FileInputStream(source); copyToFile(target, in); in.close(); } catch (IOException e) { if (null != in) { closeQuietly(in); ... |