cdm/src/main/java/ucar/nc2/util/IO.java
static public void copyFileB(File fileIn, OutputStream out, int bufferSize) throws IOException {
    try (FileInputStream fin = new FileInputStream(fileIn)) {
      InputStream in = new BufferedInputStream(fin);
      IO.copyB(in, out, bufferSize);
    }
  }
static public void copyFileB(File fileIn, OutputStream out, int bufferSize) throws IOException {
    try (FileInputStream fin = new FileInputStream(fileIn)) {
      InputStream in = new BufferedInputStream(fin);
      IO.copyB(in, out, bufferSize);
    }
  }
copy file to output stream, specify internal buffer size

@param fileIn     copy this file
@param out        copy to this stream
@param bufferSize internal buffer size.
@throws java.io.IOException on io error