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

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

本文整理了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

  1. @Override
  2. public ByteBuf skipBytes(int length) {
  3. buf.skipBytes(length);
  4. return this;
  5. }

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

  1. @Override
  2. public ByteBuf skipBytes(int length) {
  3. buf.skipBytes(length);
  4. return this;
  5. }

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

  1. @Override
  2. public ByteBuf skipBytes(int length) {
  3. buf.skipBytes(length);
  4. return this;
  5. }

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

  1. @Override
  2. public ByteBuf skipBytes(int length) {
  3. buf.skipBytes(length);
  4. return this;
  5. }

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

  1. private static void failOnFrameLengthLessThanInitialBytesToStrip(ByteBuf in,
  2. long frameLength,
  3. int initialBytesToStrip) {
  4. in.skipBytes((int) frameLength);
  5. throw new CorruptedFrameException(
  6. "Adjusted frame length (" + frameLength + ") is less " +
  7. "than initialBytesToStrip: " + initialBytesToStrip);
  8. }

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

  1. @Override
  2. public ByteBuf skipBytes(int length) {
  3. checkReadableBytes(length);
  4. buffer.skipBytes(length);
  5. return this;
  6. }

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

  1. private static void failOnFrameLengthLessThanLengthFieldEndOffset(ByteBuf in,
  2. long frameLength,
  3. int lengthFieldEndOffset) {
  4. in.skipBytes(lengthFieldEndOffset);
  5. throw new CorruptedFrameException(
  6. "Adjusted frame length (" + frameLength + ") is less " +
  7. "than lengthFieldEndOffset: " + lengthFieldEndOffset);
  8. }

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

  1. @Override
  2. public int skipBytes(int n) throws IOException {
  3. int nBytes = Math.min(available(), n);
  4. buffer.skipBytes(nBytes);
  5. return nBytes;
  6. }

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

  1. @Override
  2. public int skipBytes(int n) throws IOException {
  3. int nBytes = Math.min(available(), n);
  4. buffer.skipBytes(nBytes);
  5. return nBytes;
  6. }

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

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

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

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

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

  1. private static void failOnFrameLengthLessThanLengthFieldEndOffset(ByteBuf in,
  2. long frameLength,
  3. int lengthFieldEndOffset) {
  4. in.skipBytes(lengthFieldEndOffset);
  5. throw new CorruptedFrameException(
  6. "Adjusted frame length (" + frameLength + ") is less " +
  7. "than lengthFieldEndOffset: " + lengthFieldEndOffset);
  8. }

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

  1. private void discardingTooLongFrame(ByteBuf in) {
  2. long bytesToDiscard = this.bytesToDiscard;
  3. int localBytesToDiscard = (int) Math.min(bytesToDiscard, in.readableBytes());
  4. in.skipBytes(localBytesToDiscard);
  5. bytesToDiscard -= localBytesToDiscard;
  6. this.bytesToDiscard = bytesToDiscard;
  7. failIfNecessary(false);
  8. }

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

  1. private void discardingTooLongFrame(ByteBuf in) {
  2. long bytesToDiscard = this.bytesToDiscard;
  3. int localBytesToDiscard = (int) Math.min(bytesToDiscard, in.readableBytes());
  4. in.skipBytes(localBytesToDiscard);
  5. bytesToDiscard -= localBytesToDiscard;
  6. this.bytesToDiscard = bytesToDiscard;
  7. failIfNecessary(false);
  8. }

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

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

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

  1. static String readUsAscii(ByteBuf buffer, int length) {
  2. String s = buffer.toString(buffer.readerIndex(), length, CharsetUtil.US_ASCII);
  3. buffer.skipBytes(length);
  4. return s;
  5. }
  6. }

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

  1. static String readUsAscii(ByteBuf buffer, int length) {
  2. String s = buffer.toString(buffer.readerIndex(), length, CharsetUtil.US_ASCII);
  3. buffer.skipBytes(length);
  4. return s;
  5. }
  6. }

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

  1. private void decodeNonJdkCompatible(ChannelHandlerContext ctx, ByteBuf in) {
  2. try {
  3. in.skipBytes(unwrap(ctx, in, in.readerIndex(), in.readableBytes()));
  4. } catch (Throwable cause) {
  5. handleUnwrapThrowable(ctx, cause);
  6. }
  7. }

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

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

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

  1. private void decodeNonJdkCompatible(ChannelHandlerContext ctx, ByteBuf in) {
  2. try {
  3. in.skipBytes(unwrap(ctx, in, in.readerIndex(), in.readableBytes()));
  4. } catch (Throwable cause) {
  5. handleUnwrapThrowable(ctx, cause);
  6. }
  7. }

相关文章