Java 类io.netty.util.ByteProcessor 实例源码

项目:NioSmtpClient    文件:DotStuffing.java   
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;
}
项目:HeliosStreams    文件:ByteBufReaderSource.java   
/**
 * 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;
}
项目:ProtocolSupportBungee    文件:ReplayingDecoderBuffer.java   
@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);
}
项目:resp-server    文件:RedisDecoder.java   
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;
}
项目:ProtocolSupport    文件:ReplayingDecoderBuffer.java   
@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);
}
项目:skylla    文件:SkyllaBuffer.java   
@Override
public int forEachByte(ByteProcessor byteProcessor) {
    return handle.forEachByte(byteProcessor);
}
项目:skylla    文件:SkyllaBuffer.java   
@Override
public int forEachByte(int i, int i1, ByteProcessor byteProcessor) {
    return handle.forEachByte(i, i1, byteProcessor);
}
项目:skylla    文件:SkyllaBuffer.java   
@Override
public int forEachByteDesc(ByteProcessor byteProcessor) {
    return handle.forEachByteDesc(byteProcessor);
}
项目:skylla    文件:SkyllaBuffer.java   
@Override
public int forEachByteDesc(int i, int i1, ByteProcessor byteProcessor) {
    return handle.forEachByteDesc(i, i1, byteProcessor);
}
项目:RakNetty    文件:WrappedBuf.java   
@Override
public int forEachByte(ByteProcessor processor) {
    return buf.forEachByte(processor);
}
项目:RakNetty    文件:WrappedBuf.java   
@Override
public int forEachByte(int index, int length, ByteProcessor processor) {
    return buf.forEachByte(index, length, processor);
}
项目:RakNetty    文件:WrappedBuf.java   
@Override
public int forEachByteDesc(ByteProcessor processor) {
    return buf.forEachByteDesc(processor);
}
项目:RakNetty    文件:WrappedBuf.java   
@Override
public int forEachByteDesc(int index, int length, ByteProcessor processor) {
    return buf.forEachByteDesc(index, length, processor);
}
项目:UnknownPandaServer    文件:ByteBufWrapper.java   
@Override
public int forEachByte(final ByteProcessor byteProcessor) {
    return byteBuf.forEachByte(byteProcessor);
}
项目:UnknownPandaServer    文件:ByteBufWrapper.java   
@Override
public int forEachByte(final int i, final int i1, final ByteProcessor byteProcessor) {
    return byteBuf.forEachByte(i, i1, byteProcessor);
}
项目:UnknownPandaServer    文件:ByteBufWrapper.java   
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
    return byteBuf.forEachByteDesc(byteProcessor);
}
项目:UnknownPandaServer    文件:ByteBufWrapper.java   
@Override
public int forEachByteDesc(final int i, final int i1, final ByteProcessor byteProcessor) {
    return byteBuf.forEachByteDesc(i, i1, byteProcessor);
}
项目:Diorite-old    文件:PacketDataSerializer.java   
@Override
public int forEachByte(final ByteProcessor bytebufprocessor)
{
    return this.byteBuf.forEachByte(bytebufprocessor);
}
项目:Diorite-old    文件:PacketDataSerializer.java   
@Override
public int forEachByte(final int i, final int j, final ByteProcessor bytebufprocessor)
{
    return this.byteBuf.forEachByte(i, j, bytebufprocessor);
}
项目:Diorite-old    文件:PacketDataSerializer.java   
@Override
public int forEachByteDesc(final ByteProcessor bytebufprocessor)
{
    return this.byteBuf.forEachByteDesc(bytebufprocessor);
}
项目:Diorite-old    文件:PacketDataSerializer.java   
@Override
public int forEachByteDesc(final int i, final int j, final ByteProcessor bytebufprocessor)
{
    return this.byteBuf.forEachByteDesc(i, j, bytebufprocessor);
}
项目:ProtocolSupportBungee    文件:ReplayingDecoderBuffer.java   
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
    return this.buffer.forEachByteDesc(byteProcessor);
}
项目:ProtocolSupport    文件:ReplayingDecoderBuffer.java   
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
    return this.buffer.forEachByteDesc(byteProcessor);
}
项目:ProtocolSupport    文件:WrappingBuffer.java   
@Override
public int forEachByte(final ByteProcessor byteProcessor) {
    return this.buf.forEachByte(byteProcessor);
}
项目:ProtocolSupport    文件:WrappingBuffer.java   
@Override
public int forEachByte(final int n, final int n2, final ByteProcessor byteProcessor) {
    return this.buf.forEachByte(n, n2, byteProcessor);
}
项目:ProtocolSupport    文件:WrappingBuffer.java   
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
    return this.buf.forEachByteDesc(byteProcessor);
}
项目:ProtocolSupport    文件:WrappingBuffer.java   
@Override
public int forEachByteDesc(final int n, final int n2, final ByteProcessor byteProcessor) {
    return this.buf.forEachByteDesc(n, n2, byteProcessor);
}
项目:lettuce-core    文件:EmptyByteBuf.java   
@Override
public int forEachByte(ByteProcessor byteProcessor) {
    return 0;
}
项目:lettuce-core    文件:EmptyByteBuf.java   
@Override
public int forEachByte(int i, int i1, ByteProcessor byteProcessor) {
    return 0;
}
项目:lettuce-core    文件:EmptyByteBuf.java   
@Override
public int forEachByteDesc(ByteProcessor byteProcessor) {
    return 0;
}
项目:lettuce-core    文件:EmptyByteBuf.java   
@Override
public int forEachByteDesc(int i, int i1, ByteProcessor byteProcessor) {
    return 0;
}
项目:CodeChickenLib    文件:PacketCustom.java   
@Override public int forEachByte(ByteProcessor processor) {return buf.forEachByte(processor);}
项目:CodeChickenLib    文件:PacketCustom.java   
@Override public int forEachByte(int index, int length, ByteProcessor processor) {return buf.forEachByte(index, length, processor);}
项目:CodeChickenLib    文件:PacketCustom.java   
@Override public int forEachByteDesc(ByteProcessor processor) {return buf.forEachByteDesc(processor);}
项目:CodeChickenLib    文件:PacketCustom.java   
@Override public int forEachByteDesc(int index, int length, ByteProcessor processor) {return buf.forEachByteDesc(index, length, processor);}