code: public static long copy(FileInputStream in, FileOutputStream out) throws IOException {
          FileChannel source = null;
          FileChannel destination = null;
          try {
              source = in.getChannel();
              destination = out.getChannel();
              return source.transferTo(0, source.size(), destination);
          } finally {
              CloseableUtils.close(source);
              CloseableUtils.close(destination);
          }
      }
docs: Copy the file using streams.
  @param in source.
  @param out destination.
  @see java.nio.channels.FileChannel#transferTo(long, long, java.nio.channels.WritableByteChannel)
  @return the transferred byte count.
  @throws IOException