public static boolean needsQuoting(byte[] data, int off, int len) {
    if (off + len > data.length) {
      throw new IllegalStateException(
        "off+len=" + off + len + " should be lower" + " than data length=" + data.length);
    }
    for (int i = off; i < off + len; ++i) {
      switch (data[i]) {
        case '&':
        case '<':
        case '>':
        case '\'':
        case '"':
          return true;
        default:
          break;
      }
    }
    return false;
  }
Does the given string need to be quoted?
@param data the string to check
@param off  the starting position
@param len  the number of bytes to check
@return does the string contain any of the active html characters?
hbase-http/src/main/java/org/apache/hadoop/hbase/http/HtmlQuoting.java