List of utility methods to do FileInputStream Copy
void | copyFile(File source, File destination) This method copies a single file. copyFile(new FileInputStream(source), destination);
|
void | copyFile(File source, File destination) Copies a file from the given streams. copyFile(new FileInputStream(source), new FileOutputStream(destination)); |
void | copyFile(File source, File destination) copy File if (destination.isDirectory()) destination = new File(destination, source.getName()); FileInputStream input = new FileInputStream(source); copyFile(input, destination); |
boolean | copyFile(File source, File target) Creates a copy of a file boolean backup = true; try { byte[] buf = new byte[COPY_BUFFER_SIZE]; FileInputStream fis = new FileInputStream(source); OutputStream fos = createOutputStream(target); int len; do { len = fis.read(buf); ... |
void | copyFile(File source, File target) Copies a file to a different location InputStream inputStream = new FileInputStream(source); OutputStream outputStream = new FileOutputStream(target); try { copyFile(inputStream, outputStream); } finally { if (inputStream != null) { inputStream.close(); if (outputStream != null) { outputStream.close(); |
void | copyFile(File source, File target) copy File InputStream in = null; OutputStream out = null; try { in = new FileInputStream(source); out = new FileOutputStream(target); while (true) { int data = in.read(); if (data == -1) { ... |
void | copyFile(File source, File target) copy File int size = (int) source.length(); byte[] buffer = new byte[size]; InputStream in = null; try { in = new FileInputStream(source); in.read(buffer); } catch (IOException ex) { throw new RuntimeException(ex); ... |
void | copyFile(File source, File target) copy File try (InputStream in = new FileInputStream(source); OutputStream out = new FileOutputStream(target)) { byte[] buf = new byte[1024]; int length; while ((length = in.read(buf)) > 0) { out.write(buf, 0, length); |
void | copyFile(File source, File target) copy File if (!target.exists() || source.length() != target.length() || source.lastModified() > target.lastModified()) { copyFile(new FileInputStream(source), target); |
void | copyFile(File source, File target) copy File try (FileInputStream in = new FileInputStream(source); FileOutputStream out = new FileOutputStream(target)) { copyStream(in, out); |