Java File Copy FileCopy(InputStream input, OutputStream output, int bufferSize)

Here you can find the source of FileCopy(InputStream input, OutputStream output, int bufferSize)

Description

File Copy

License

Open Source License

Declaration

public static void FileCopy(InputStream input, OutputStream output, int bufferSize) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static void FileCopy(InputStream input, OutputStream output, int bufferSize) throws IOException {
        byte[] buf = new byte[bufferSize];
        int n = input.read(buf);
        while (n >= 0) {
            output.write(buf, 0, n);/*w  w  w . j ava  2s . co  m*/
            n = input.read(buf);
        }
        output.flush();
    }
}

Related

  1. copyFileToPath(String fileToPath, String fileName, String sourceFile)
  2. doCopyFile(File srcFile, File destFile, boolean preserveFileDate)
  3. doCopyFile(File srcFile, File destFile, boolean preserveFileDate)
  4. fileCopy(File source, String dest)
  5. fileCopy(File srcFile, File tarFile)
  6. fileCopy(String from, String to)
  7. fileCopy(String from, String to)
  8. fileCopy(String fromPath, String toPath)
  9. fileCopy(String oldFilePath, String newFilePath, boolean isCover)