private boolean isValidURLChar(int pos) {
        byte b = buffer.get(pos);
        char ch = (char) b;

        // Valid URL characters as defined here:  http://tools.ietf.org/html/rfc3986#section-2
        return Character.isDigit(ch) || Character.isLetter(ch) || ch == '-' || ch == '.' || ch == '_'
                || ch == '~' || ch == ':' || ch == '/' || ch == '?' || ch == '#' || ch == '[' || ch == ']'
                || ch == '@' || ch == '!' || ch == '$' || ch == '&' || ch == '\'' || ch == '(' || ch == ')'
                || ch == '*' || ch == '+' || ch == ',' || ch == ';' || ch == '=';
    }
@param pos the position to check
@return true if the character at position 'pos' is a valid URL character
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/rewrite/URLRewritingStream.java