Example usage for io.netty.buffer ByteBufProcessor FIND_LF

List of usage examples for io.netty.buffer ByteBufProcessor FIND_LF

Introduction

In this page you can find the example usage for io.netty.buffer ByteBufProcessor FIND_LF.

Prototype

ByteBufProcessor FIND_LF

To view the source code for io.netty.buffer ByteBufProcessor FIND_LF.

Click Source Link

Usage

From source file:tonivade.redis.protocol.RedisDecoder.java

License:Open Source License

private static int findEndOfLine(final ByteBuf buffer) {
    int i = buffer.forEachByte(ByteBufProcessor.FIND_LF);
    if (i > 0 && buffer.getByte(i - 1) == '\r') {
        i--;//from  w ww  . j a v a 2  s .  c  om
    }
    return i;
}