当前位置: 首页>>代码示例>>Java>>正文


Java ByteProcessor类代码示例

本文整理汇总了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);
}
 
开发者ID:MagicDroidX,项目名称:RakNetty,代码行数:5,代码来源:WrappedBuf.java

示例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;
}
 
开发者ID:HubSpot,项目名称:NioSmtpClient,代码行数:30,代码来源:DotStuffing.java

示例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;
}
 
开发者ID:nickman,项目名称:HeliosStreams,代码行数:12,代码来源:ByteBufReaderSource.java

示例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);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportBungee,代码行数:8,代码来源:ReplayingDecoderBuffer.java

示例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;
}
 
开发者ID:tonivade,项目名称:resp-server,代码行数:8,代码来源:RedisDecoder.java

示例6: forEachByte

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(ByteProcessor byteProcessor) {
    return handle.forEachByte(byteProcessor);
}
 
开发者ID:D3adspaceEnterprises,项目名称:skylla,代码行数:5,代码来源:SkyllaBuffer.java

示例7: forEachByteDesc

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(ByteProcessor byteProcessor) {
    return handle.forEachByteDesc(byteProcessor);
}
 
开发者ID:D3adspaceEnterprises,项目名称:skylla,代码行数:5,代码来源:SkyllaBuffer.java

示例8: forEachByteDesc

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(ByteProcessor processor) {
    return buf.forEachByteDesc(processor);
}
 
开发者ID:MagicDroidX,项目名称:RakNetty,代码行数:5,代码来源:WrappedBuf.java

示例9: forEachByte

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(final ByteProcessor byteProcessor) {
    return byteBuf.forEachByte(byteProcessor);
}
 
开发者ID:dzikoysk,项目名称:UnknownPandaServer,代码行数:5,代码来源:ByteBufWrapper.java

示例10: forEachByteDesc

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
    return byteBuf.forEachByteDesc(byteProcessor);
}
 
开发者ID:dzikoysk,项目名称:UnknownPandaServer,代码行数:5,代码来源:ByteBufWrapper.java

示例11: forEachByte

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(final ByteProcessor bytebufprocessor)
{
    return this.byteBuf.forEachByte(bytebufprocessor);
}
 
开发者ID:Diorite,项目名称:Diorite-old,代码行数:6,代码来源:PacketDataSerializer.java

示例12: forEachByteDesc

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(final ByteProcessor bytebufprocessor)
{
    return this.byteBuf.forEachByteDesc(bytebufprocessor);
}
 
开发者ID:Diorite,项目名称:Diorite-old,代码行数:6,代码来源:PacketDataSerializer.java

示例13: forEachByte

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(final ByteProcessor byteProcessor) {
	return this.buf.forEachByte(byteProcessor);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:5,代码来源:WrappingBuffer.java

示例14: forEachByteDesc

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByteDesc(final ByteProcessor byteProcessor) {
	return this.buf.forEachByteDesc(byteProcessor);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:5,代码来源:WrappingBuffer.java

示例15: forEachByte

import io.netty.util.ByteProcessor; //导入依赖的package包/类
@Override
public int forEachByte(ByteProcessor byteProcessor) {
    return 0;
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:5,代码来源:EmptyByteBuf.java


注:本文中的io.netty.util.ByteProcessor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。