code: public static void copy(File file, OutputStream out) throws IOException {
      FileInputStream in = new FileInputStream(file);
      try {
        IOUtils.copy(new BufferedInputStream(in), out);
      }
      finally {
        IOUtils.closeQuietly(in);
      }
    }
docs: Copies the given file into an output stream.
  
  @param file input file (must exist).
  @param out output stream.
  
  @throws java.io.IOException if file is not found or copying fails