com.couchbase.client.deps.io.netty.buffer.ByteBuf.skipBytes()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(278)

本文整理了Java中com.couchbase.client.deps.io.netty.buffer.ByteBuf.skipBytes()方法的一些代码示例,展示了ByteBuf.skipBytes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.skipBytes()方法的具体详情如下:
包路径:com.couchbase.client.deps.io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:skipBytes

ByteBuf.skipBytes介绍

[英]Increases the current readerIndex by the specified length in this buffer.
[中]在此缓冲区中将当前readerIndex增加指定的长度。

代码示例

代码示例来源:origin: com.couchbase.client/core-io

@Override
public ByteBuf skipBytes(int length) {
  buf.skipBytes(length);
  return this;
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public ByteBuf skipBytes(int length) {
  buf.skipBytes(length);
  return this;
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public ByteBuf skipBytes(int length) {
  buf.skipBytes(length);
  return this;
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public ByteBuf skipBytes(int length) {
  buf.skipBytes(length);
  return this;
}

代码示例来源:origin: com.couchbase.client/core-io

private static void failOnFrameLengthLessThanInitialBytesToStrip(ByteBuf in,
                                 long frameLength,
                                 int initialBytesToStrip) {
  in.skipBytes((int) frameLength);
  throw new CorruptedFrameException(
    "Adjusted frame length (" + frameLength + ") is less " +
     "than initialBytesToStrip: " + initialBytesToStrip);
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public ByteBuf skipBytes(int length) {
  checkReadableBytes(length);
  buffer.skipBytes(length);
  return this;
}

代码示例来源:origin: com.couchbase.client/core-io

private static void failOnFrameLengthLessThanLengthFieldEndOffset(ByteBuf in,
                                 long frameLength,
                                 int lengthFieldEndOffset) {
  in.skipBytes(lengthFieldEndOffset);
  throw new CorruptedFrameException(
    "Adjusted frame length (" + frameLength + ") is less " +
     "than lengthFieldEndOffset: " + lengthFieldEndOffset);
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public int skipBytes(int n) throws IOException {
  int nBytes = Math.min(available(), n);
  buffer.skipBytes(nBytes);
  return nBytes;
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public int skipBytes(int n) throws IOException {
  int nBytes = Math.min(available(), n);
  buffer.skipBytes(nBytes);
  return nBytes;
}

代码示例来源:origin: couchbase/couchbase-jvm-core

private static void failOnNegativeLengthField(ByteBuf in, long frameLength, int lengthFieldEndOffset) {
  in.skipBytes(lengthFieldEndOffset);
  throw new CorruptedFrameException(
    "negative pre-adjustment length field: " + frameLength);
}

代码示例来源:origin: com.couchbase.client/core-io

private static void failOnNegativeLengthField(ByteBuf in, long frameLength, int lengthFieldEndOffset) {
  in.skipBytes(lengthFieldEndOffset);
  throw new CorruptedFrameException(
    "negative pre-adjustment length field: " + frameLength);
}

代码示例来源:origin: couchbase/couchbase-jvm-core

private static void failOnFrameLengthLessThanLengthFieldEndOffset(ByteBuf in,
                                 long frameLength,
                                 int lengthFieldEndOffset) {
  in.skipBytes(lengthFieldEndOffset);
  throw new CorruptedFrameException(
    "Adjusted frame length (" + frameLength + ") is less " +
     "than lengthFieldEndOffset: " + lengthFieldEndOffset);
}

代码示例来源:origin: com.couchbase.client/core-io

private void discardingTooLongFrame(ByteBuf in) {
  long bytesToDiscard = this.bytesToDiscard;
  int localBytesToDiscard = (int) Math.min(bytesToDiscard, in.readableBytes());
  in.skipBytes(localBytesToDiscard);
  bytesToDiscard -= localBytesToDiscard;
  this.bytesToDiscard = bytesToDiscard;
  failIfNecessary(false);
}

代码示例来源:origin: couchbase/couchbase-jvm-core

private void discardingTooLongFrame(ByteBuf in) {
  long bytesToDiscard = this.bytesToDiscard;
  int localBytesToDiscard = (int) Math.min(bytesToDiscard, in.readableBytes());
  in.skipBytes(localBytesToDiscard);
  bytesToDiscard -= localBytesToDiscard;
  this.bytesToDiscard = bytesToDiscard;
  failIfNecessary(false);
}

代码示例来源:origin: com.couchbase.client/core-io

private static int readLengthField(ByteBuf buffer) {
  int length = getSignedInt(buffer, buffer.readerIndex());
  buffer.skipBytes(LENGTH_FIELD_SIZE);
  return length;
}

代码示例来源:origin: com.couchbase.client/core-io

static String readUsAscii(ByteBuf buffer, int length) {
    String s = buffer.toString(buffer.readerIndex(), length, CharsetUtil.US_ASCII);
    buffer.skipBytes(length);
    return s;
  }
}

代码示例来源:origin: couchbase/couchbase-jvm-core

static String readUsAscii(ByteBuf buffer, int length) {
    String s = buffer.toString(buffer.readerIndex(), length, CharsetUtil.US_ASCII);
    buffer.skipBytes(length);
    return s;
  }
}

代码示例来源:origin: com.couchbase.client/core-io

private void decodeNonJdkCompatible(ChannelHandlerContext ctx, ByteBuf in) {
  try {
    in.skipBytes(unwrap(ctx, in, in.readerIndex(), in.readableBytes()));
  } catch (Throwable cause) {
    handleUnwrapThrowable(ctx, cause);
  }
}

代码示例来源:origin: com.couchbase.client/core-io

private HttpContent invalidChunk(ByteBuf in, Exception cause) {
  currentState = State.BAD_MESSAGE;
  // Advance the readerIndex so that ByteToMessageDecoder does not complain
  // when we produced an invalid message without consuming anything.
  in.skipBytes(in.readableBytes());
  HttpContent chunk = new DefaultLastHttpContent(Unpooled.EMPTY_BUFFER);
  chunk.setDecoderResult(DecoderResult.failure(cause));
  message = null;
  trailer = null;
  return chunk;
}

代码示例来源:origin: couchbase/couchbase-jvm-core

private void decodeNonJdkCompatible(ChannelHandlerContext ctx, ByteBuf in) {
  try {
    in.skipBytes(unwrap(ctx, in, in.readerIndex(), in.readableBytes()));
  } catch (Throwable cause) {
    handleUnwrapThrowable(ctx, cause);
  }
}

相关文章