Java Code Examples for io.netty.util.AsciiString#charAt()

The following examples show how to use io.netty.util.AsciiString#charAt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpHeaderNames.java    From armeria with Apache License 2.0 6 votes vote down vote up
private static String malformedHeaderNameMessage(AsciiString name) {
    final StringBuilder buf = new StringBuilder(IntMath.saturatedAdd(name.length(), 64));
    buf.append("malformed header name: ");

    final int nameLength = name.length();
    for (int i = 0; i < nameLength; i++) {
        final char ch = name.charAt(i);
        if (PROHIBITED_NAME_CHARS.get(ch)) {
            buf.append(PROHIBITED_NAME_CHAR_NAMES[ch]);
        } else {
            buf.append(ch);
        }
    }

    return buf.toString();
}
 
Example 2
Source File: GrpcHttp2HeadersUtils.java    From grpc-nebula-java with Apache License 2.0 4 votes vote down vote up
protected static boolean isPseudoHeader(AsciiString str) {
  return !str.isEmpty() && str.charAt(0) == ':';
}
 
Example 3
Source File: GrpcHttp2HeadersUtils.java    From grpc-java with Apache License 2.0 4 votes vote down vote up
protected static boolean isPseudoHeader(AsciiString str) {
  return !str.isEmpty() && str.charAt(0) == ':';
}