code: public void copyResource(DocPath resource, boolean overwrite, boolean replaceNewLine) {
          if (exists() && !overwrite)
              return;
  
          try {
              InputStream in = Configuration.class.getResourceAsStream(resource.getPath());
              if (in == null)
                  return;
  
              try (OutputStream out = openOutputStream()) {
                  if (!replaceNewLine) {
                      byte[] buf = new byte[2048];
                      int n;
                      while ((n = in.read(buf)) > 0)
                          out.write(buf, 0, n);
                  } else {
                      try (BufferedReader reader = new BufferedReader(new InputStreamReader(in));
                           BufferedWriter writer = new BufferedWriter(configuration.docencoding == null
                                                                      ? new OutputStreamWriter(out)
                                                                      : new OutputStreamWriter(out, configuration.docencoding))) {
                          String line;
                          while ((line = reader.readLine()) != null) {
                              writer.write(line);
                              writer.write(DocletConstants.NL);
                          }
                      }
                  }
              } finally {
                  in.close();
              }
          } catch (IOException e) {
              e.printStackTrace(System.err);
              throw new DocletAbortException(e);
          }
      }
docs: Copy the contents of a resource file to this file.
  @param resource the path of the resource, relative to the package of this class
  @param overwrite whether or not to overwrite the file if it already exists
  @param replaceNewLine if false, the file is copied as a binary file;
  if true, the file is written line by line, using the platform line
  separator