code: public static void copy(InputStream is, OutputStream os, boolean close) throws IOException {
          byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
          int len;
          try {
              while ((len = is.read(buf)) != -1) {
                  os.write(buf, 0, len);
              }
          } finally {
              if (close) {
                  closeQuietly(is);
                  closeQuietly(os);
              }
          }
      }
docs: Copies all data from the given input stream to the given output stream.
  
  @param is
  the input stream.
  @param os
  the output stream.
  @param close
  <code>true</code> if both streams are closed afterwards, <code>false</code> otherwise.
  
  @throws IOException
  if an I/O error occurs.