public static String quote(byte[] auth) {
    int escapeChars = 0;

    for (int i = 0; i < auth.length; i++)
      if (auth[i] == '"' || auth[i] == '\\') escapeChars++;

    byte[] escapedAuth = new byte[auth.length + escapeChars + 2];
    int index = 1;
    for (int i = 0; i < auth.length; i++) {
      if (auth[i] == '"' || auth[i] == '\\') {
        escapedAuth[index++] = '\\';
      }
      escapedAuth[index++] = auth[i];
    }

    escapedAuth[0] = '"';
    escapedAuth[escapedAuth.length - 1] = '"';

    return Bytes.toString(escapedAuth);
  }
Helps in quoting authentication Strings. Use this if unicode characters to be used in
expression or special characters like '(', ')', '"','\','&amp;','|','!'
hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/CellVisibility.java