List of utility methods to do FileInputStream Copy
boolean | copyFile(String srcPath, String dstPath, boolean replace) copy a file InputStream inputStream = null; FileOutputStream fileOutputStream = null; try { int byteRead; File srcFile = new File(srcPath); File dstFile = new File(dstPath); if (dstFile.exists() && !replace) { return false; ... |
void | copyFile(String srFile, String dtFile) copy File try { File f1 = new File(srFile); File f2 = new File(dtFile); InputStream in = new FileInputStream(f1); OutputStream out = new FileOutputStream(f2); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { ... |
void | copyFile(String srFile, String dtFile) copy File try { File f1 = new File(srFile); File f2 = new File(dtFile); copyFile(f1, f2); } catch (FileNotFoundException ex) { System.out.println(ex.getMessage() + " in the specified directory."); System.exit(0); } catch (IOException e) { ... |
boolean | copyFile(String srFile, String dtFile) copy File boolean ok = false; try { File f1 = new File(srFile); File f2 = new File(dtFile); InputStream in = new FileInputStream(f1); OutputStream out = new FileOutputStream(f2); byte[] buf = new byte[1024]; int len; ... |
void | copyFile(String srFilePath, String dtFilePath) copy File try { File srFile = new File(srFilePath); File dtFile = new File(dtFilePath); InputStream in = new FileInputStream(srFile); OutputStream out = new FileOutputStream(dtFile); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { ... |
void | copyFile(String target, String source) copy File byte[] bytes = getFileInBytes(source); try { writeBytes(bytes, target); } catch (IOException e) { e.printStackTrace(); |
void | copyFileAndReName(String destPath, String srcPath, String srcFile, String destFile) copy File And Re Name (new File(destPath)).mkdirs(); File file = new File(srcPath + srcFile); if (file.exists()) { FileInputStream input = new FileInputStream(file); FileOutputStream output = new FileOutputStream(destPath + "/" + destFile); byte[] b = new byte[1024 * 5]; int len; while ((len = input.read(b)) != -1) { ... |
void | copyFileAsStream(String srcFilePathName, String dstFilePathName) copy File As Stream FileInputStream fis = new FileInputStream(srcFilePathName); FileOutputStream fos = new FileOutputStream(dstFilePathName); byte[] buf = new byte[1024]; int i = 0; while ((i = fis.read(buf)) != -1) { fos.write(buf, 0, i); fis.close(); ... |
boolean | copyFileBin(File sourceFile, File targetFile) copy File Bin boolean deltas = (targetFile.lastModified() != sourceFile.lastModified()); if (!deltas) { deltas = deltas || (targetFile.length() != sourceFile.length()); if (deltas) { if (!targetFile.exists()) { File parentDir = targetFile.getParentFile(); if (!parentDir.isDirectory()) { ... |
void | copyFileBinary(String source, String destination) copy File Binary FileInputStream readSource = new FileInputStream(source); FileOutputStream outputDestination = new FileOutputStream(destination); byte read[] = new byte[1024]; int count = 0; while ((count = readSource.read(read, 0, 1024)) != -1) { outputDestination.write(read, 0, count); outputDestination.flush(); ... |