本文整理汇总了Java中io.netty.util.ByteProcessor类的典型用法代码示例。如果您正苦于以下问题:Java ByteProcessor类的具体用法?Java ByteProcessor怎么用?Java ByteProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ByteProcessor类属于io.netty.util包,在下文中一共展示了ByteProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: forEachByte
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(ByteProcessor processor) {
return buf.forEachByte(processor);
}
示例2: findDotAtBeginningOfLine
import io.netty.util.ByteProcessor; //导入依赖的package包/类
private static int findDotAtBeginningOfLine(ByteBuf buffer, int startAt, byte[] previousBytes) {
int length = buffer.readableBytes();
if (previousBytes[0] == CR && previousBytes[1] == LF && buffer.getByte(startAt) == DOT) {
return startAt;
}
if (previousBytes[1] == CR && length >= 2 && buffer.getByte(startAt) == LF && buffer.getByte(startAt + 1) == DOT) {
return startAt + 1;
}
int i = startAt;
while (++i < length) {
i = buffer.forEachByte(i, length - i, ByteProcessor.FIND_LF);
if (i == -1) {
return -1;
}
if (buffer.getByte(i - 1) == CR) {
if (i + 1 < length && buffer.getByte(i + 1) == DOT) {
return i + 1;
} else {
continue;
}
}
}
return -1;
}
示例3: findEndOfLine
import io.netty.util.ByteProcessor; //导入依赖的package包/类
/**
* Returns the index in the buffer of the end of line found.
* Returns -1 if no end of line was found in the buffer.
*/
private static int findEndOfLine(final ByteBuf buffer) {
int i = buffer.forEachByte(ByteProcessor.FIND_LF);
if (i > 0 && buffer.getByte(i - 1) == '\r') {
i--;
}
return i;
}
示例4: forEachByteDesc
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(final int n, final int n2, final ByteProcessor byteProcessor) {
if ((n + n2) > this.buffer.writerIndex()) {
throw EOF;
}
return this.buffer.forEachByteDesc(n, n2, byteProcessor);
}
示例5: findEndOfLine
import io.netty.util.ByteProcessor; //导入依赖的package包/类
private static int findEndOfLine(final ByteBuf buffer) {
int i = buffer.forEachByte(ByteProcessor.FIND_CRLF);
if (i > 0 && buffer.getByte(i - 1) == '\r') {
i--;
}
return i;
}
示例6: forEachByte
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(ByteProcessor byteProcessor) {
return handle.forEachByte(byteProcessor);
}
示例7: forEachByteDesc
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(ByteProcessor byteProcessor) {
return handle.forEachByteDesc(byteProcessor);
}
示例8: forEachByteDesc
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(ByteProcessor processor) {
return buf.forEachByteDesc(processor);
}
示例9: forEachByte
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(final ByteProcessor byteProcessor) {
return byteBuf.forEachByte(byteProcessor);
}
示例10: forEachByteDesc
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
return byteBuf.forEachByteDesc(byteProcessor);
}
示例11: forEachByte
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(final ByteProcessor bytebufprocessor)
{
return this.byteBuf.forEachByte(bytebufprocessor);
}
示例12: forEachByteDesc
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(final ByteProcessor bytebufprocessor)
{
return this.byteBuf.forEachByteDesc(bytebufprocessor);
}
示例13: forEachByte
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(final ByteProcessor byteProcessor) {
return this.buf.forEachByte(byteProcessor);
}
示例14: forEachByteDesc
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
return this.buf.forEachByteDesc(byteProcessor);
}
示例15: forEachByte
import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(ByteProcessor byteProcessor) {
return 0;
}