Example usage for io.netty.util AsciiString charAt

List of usage examples for io.netty.util AsciiString charAt

Introduction

In this page you can find the example usage for io.netty.util AsciiString charAt.

Prototype

@Override
    public char charAt(int index) 

Source Link

Usage

From source file:com.spotify.netty4.handler.codec.zmtp.benchmarks.CustomReqRepBenchmark.java

License:Apache License

private static boolean asciiEquals(final AsciiString s, final ByteBuf data, final int size) {
    final int ix = data.readerIndex();
    if (size != s.length()) {
        return false;
    }//from   ww w. j a  v a2  s.c om
    for (int i = 0; i < size; i++) {
        char c = (char) data.getByte(ix + i);
        if (c != s.charAt(i)) {
            return false;
        }
    }
    return true;
}