List of utility methods to do FileInputStream Copy
boolean | copyFile(File src, File toDir) copy File if (src.isFile()) { File tgt = new File(toDir, src.getName()); if (tgt.createNewFile()) { byte[] data = getContents(src); setContents(tgt, data); return true; return false; |
void | copyFile(File srcFile, File destFile) Copy a file to another FileOutputStream os = null; try (FileInputStream is = new FileInputStream(srcFile)) { os = new FileOutputStream(destFile); byte[] buffer = new byte[1024]; int bcount; while ((bcount = is.read(buffer)) > 0) os.write(buffer, 0, bcount); } finally { ... |
void | copyFile(File srcFile, File destFile) copy File FileOutputStream fos = null; FileInputStream fis = null; try { byte[] tempBuff = new byte[10240]; fis = new FileInputStream(srcFile); fos = new FileOutputStream(destFile); int readCnt; while (true) { ... |
void | copyFile(File srcFile, File destFile) copy File InputStream in = new FileInputStream(srcFile);
copyFile(in, destFile);
in.close();
|
void | copyFile(File srcFile, File destFile) copy File copyFile(srcFile, destFile, true); |
void | copyFile(File srcFile, File destFile) copy File FileOutputStream fos = new FileOutputStream(destFile); try { copyToOutputStream(srcFile, fos); } finally { fos.close(); |
void | CopyFile(File srcFile, File destFile) Copy File try { int bytesum = 0; int byteread = 0; InputStream inStream = new FileInputStream(srcFile); FileOutputStream fs = new FileOutputStream(destFile); byte[] buffer = new byte[1444]; while ((byteread = inStream.read(buffer)) != -1) { bytesum += byteread; ... |
boolean | copyFile(File srcFile, File destFile) copy File boolean result = false; try { InputStream in = new FileInputStream(srcFile); try { result = copyToFile(in, destFile); } finally { in.close(); } catch (IOException e) { result = false; return result; |
void | copyFile(File srcFile, File destFile) copy File if (!srcFile.getPath().toLowerCase().endsWith(JPG) && !srcFile.getPath().toLowerCase().endsWith(JPEG)) { return; final InputStream in = new FileInputStream(srcFile); final OutputStream out = new FileOutputStream(destFile); try { long millis = System.currentTimeMillis(); CRC32 checksum; ... |
void | copyFile(File srcFile, File destFile) Copies a source file to a target file. if (!(srcFile.exists() && srcFile.isFile())) throw new IllegalArgumentException("Source file doesn't exist: " + srcFile.getAbsolutePath()); if (destFile.exists() && destFile.isDirectory()) throw new IllegalArgumentException("Destination file is directory: " + destFile.getAbsolutePath()); FileInputStream in = new FileInputStream(srcFile); FileOutputStream out = new FileOutputStream(destFile); byte[] buffer = new byte[4096]; int no = 0; ... |