code: public void copyFile(DocFile fromFile) throws IOException {
          try (OutputStream output = openOutputStream();
               InputStream input = fromFile.openInputStream()) {
              byte[] bytearr = new byte[1024];
              int len;
              while ((len = input.read(bytearr)) != -1) {
                  output.write(bytearr, 0, len);
              }
          }
          catch (FileNotFoundException | SecurityException exc) {
          }
      }
docs: Copy the contents of another file directly to this file.