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

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

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

ByteBuf.retain介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-gobblin

assertRecordWritable(record);
if (record instanceof TupleDocument) {
 ((TupleDocument) record).content().value1().retain();

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

@Override
public FullHttpResponse retain() {
  content.retain();
  return this;
}

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

@Override
public ByteBufHolder retain() {
  data.retain();
  return this;
}

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

@Override
public PemX509Certificate retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public BinaryResponse retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public GetDesignDocumentResponse retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public MemcacheContent retain() {
  content.retain();
  return this;
}

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

@Override
public ByteBuf retain(int increment) {
  buf.retain(increment);
  return this;
}

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

@Override
public FullHttpMessage retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public BinaryMemcacheMessage retain() {
  if (extras != null) {
    extras.retain();
  }
  if (framingExtras != null) {
    framingExtras.retain();
  }
  return this;
}

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

@Override
public FullHttpResponse retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public UpsertDesignDocumentResponse retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public FullHttpMessage retain() {
  content.retain();
  return this;
}

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

@Override
public ByteBuf retain() {
  buf.retain();
  return this;
}

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

@Override
public MemcacheContent retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public HttpContent retain(int increment) {
  content.retain(increment);
  return this;
}

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

@Override
public FullBinaryMemcacheResponse retain(int increment) {
  super.retain(increment);
  content.retain(increment);
  return this;
}

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

private static Object encodeAndRetain(Object msg) {
  if (msg instanceof ByteBuf) {
    return ((ByteBuf) msg).retain();
  }
  if (msg instanceof HttpContent) {
    return ((HttpContent) msg).content().retain();
  }
  if (msg instanceof FileRegion) {
    return ((FileRegion) msg).retain();
  }
  throw new IllegalStateException("unexpected message type: " + StringUtil.simpleClassName(msg));
}

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

@Override
  protected void decode(ChannelHandlerContext ctx, SctpMessage msg, List<Object> out) throws Exception {
    if (!msg.isComplete()) {
      throw new CodecException(String.format("Received SctpMessage is not complete, please add %s in the " +
          "pipeline before this handler", SctpMessageCompletionHandler.class.getSimpleName()));
    }
    out.add(msg.content().retain());
  }
}

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

private static Object safeDuplicate(Object message) {
  if (message instanceof ByteBuf) {
    return ((ByteBuf) message).duplicate().retain();
  } else if (message instanceof ByteBufHolder) {
    return ((ByteBufHolder) message).duplicate().retain();
  } else {
    return ReferenceCountUtil.retain(message);
  }
}

相关文章