code: private static boolean isChanged(final byte[] bytes, final int length, final String filepath) throws IOException {
          Preconditions.checkArgument(length >= 0, "invalid length value: %s", length);
          Preconditions.checkArgument(bytes.length >= length, "invalid length value: %s", length);
  
          File file = new File(filepath);
          if (!file.exists()) {
              return true;
          }
          if (file.length() != length) {
              return true;
          }
          final int BUFLEN = 1048576; // 1 megabyte
          byte[] buffer = new byte[BUFLEN];
          InputStream is = new FileInputStream(file);
          try {
              int len;
              for (int offset = 0; ; offset += len) {
                  len = is.read(buffer);
                  if (len < 0) break; // eof
                  if (!arrayCompare(bytes, offset, buffer, 0, len)) return true;
              }
              return false;
          } finally {
              is.close();
          }
      }
docs: Returns true iff the bytes in an array are different from the bytes
  contained in the given file, or if the file does not exist.