code: private void writeIfChanged(byte[] b, FileObject file) throws IOException {
          boolean mustWrite = false;
          String event = "[No need to update file ";
  
          if (force) {
              mustWrite = true;
              event = "[Forcefully writing file ";
          } else {
              InputStream in;
              byte[] a;
              try {
                  // regrettably, there's no API to get the length in bytes
                  // for a FileObject, so we can't short-circuit reading the
                  // file here
                  in = file.openInputStream();
                  a = readBytes(in);
                  if (!Arrays.equals(a, b)) {
                      mustWrite = true;
                      event = "[Overwriting file ";
  
                  }
              } catch (FileNotFoundException e) {
                  mustWrite = true;
                  event = "[Creating file ";
              }
          }
  
          if (util.verbose)
              util.log(event + file + "]");
  
          if (mustWrite) {
              OutputStream out = file.openOutputStream();
              out.write(b); /* No buffering, just one big write! */
              out.close();
          }
      }
docs: /*
  Write the contents of byte[] b to a file named file.  Writing
  is done if either the file doesn't exist or if the contents are
  different.