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

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

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

ByteBuf.refCnt介绍

暂无

代码示例

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

  1. @Override
  2. public int refCnt() {
  3. return content.refCnt();
  4. }

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

  1. @Override
  2. public final int refCnt() {
  3. return buf.refCnt();
  4. }

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

  1. @Override
  2. public int refCnt() {
  3. return content.refCnt();
  4. }

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

  1. @Override
  2. public int refCnt() {
  3. return content.refCnt();
  4. }

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

  1. @Override
  2. public int refCnt() {
  3. return content.refCnt();
  4. }

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

  1. @Override
  2. public int refCnt() {
  3. return content.refCnt();
  4. }

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

  1. @Override
  2. public ByteBuf content() {
  3. if (data.refCnt() <= 0) {
  4. throw new IllegalReferenceCountException(data.refCnt());
  5. }
  6. return data;
  7. }

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

  1. @Override
  2. public ByteBuf content() {
  3. if (data.refCnt() <= 0) {
  4. throw new IllegalReferenceCountException(data.refCnt());
  5. }
  6. return data;
  7. }

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

  1. @Override
  2. public ByteBuf content() {
  3. if (data.refCnt() <= 0) {
  4. throw new IllegalReferenceCountException(data.refCnt());
  5. }
  6. return data;
  7. }

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

  1. @Override
  2. public void call(ByteBuf byteBuf) {
  3. if (byteBuf != null && byteBuf.refCnt() > 0) {
  4. byteBuf.release();
  5. }
  6. }
  7. };

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

  1. private void releaseResponseContent() {
  2. if (responseContent != null && responseContent.refCnt() > 0) {
  3. responseContent.release();
  4. }
  5. responseContent = null;
  6. }

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

  1. /**
  2. * If it is still present and open, release the content buffer. Also set it
  3. * to null so that next decoding can take a new buffer from the pool.
  4. */
  5. private void releaseResponseContent() {
  6. if (responseContent != null) {
  7. if (responseContent.refCnt() > 0) {
  8. responseContent.release();
  9. }
  10. responseContent = null;
  11. }
  12. }

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

  1. @Override
  2. public void call(ByteBuf byteBuf) {
  3. if (byteBuf != null && byteBuf.refCnt() > 0) {
  4. byteBuf.release();
  5. }
  6. }
  7. };

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

  1. /**
  2. * If it is still present and open, release the content buffer. Also set it
  3. * to null so that next decoding can take a new buffer from the pool.
  4. */
  5. private void releaseResponseContent() {
  6. if (responseContent != null) {
  7. if (responseContent.refCnt() > 0) {
  8. responseContent.release();
  9. }
  10. responseContent = null;
  11. }
  12. }

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

  1. private void releaseResponseContent() {
  2. if (responseContent != null && responseContent.refCnt() > 0) {
  3. responseContent.release();
  4. }
  5. responseContent = null;
  6. }

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

  1. private void releaseResponseContent() {
  2. if (responseContent != null && responseContent.refCnt() > 0) {
  3. responseContent.release();
  4. }
  5. responseContent = null;
  6. }

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

  1. /**
  2. * Utility method to ensure good cleanup when throwing an exception from a constructor.
  3. *
  4. * Cleans the content composite buffer by releasing it before throwing the exception.
  5. */
  6. protected void cleanUpAndThrow(RuntimeException e) {
  7. if (content != null && content.refCnt() > 0) {
  8. content.release();
  9. }
  10. throw e;
  11. }

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

  1. protected final void discardSomeReadBytes() {
  2. if (cumulation != null && !first && cumulation.refCnt() == 1) {
  3. // discard some bytes if possible to make more room in the
  4. // buffer but only if the refCnt == 1 as otherwise the user may have
  5. // used slice().retain() or duplicate().retain().
  6. //
  7. // See:
  8. // - https://github.com/netty/netty/issues/2327
  9. // - https://github.com/netty/netty/issues/1764
  10. cumulation.discardSomeReadBytes();
  11. }
  12. }

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

  1. private static void releaseAll(List<ByteBuf> byteBufs) {
  2. for (ByteBuf byteBuf : byteBufs) {
  3. if (byteBuf != null && byteBuf.refCnt() > 0) {
  4. byteBuf.release();
  5. }
  6. }
  7. }

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

  1. @Override
  2. public void call(UpsertResponse response) {
  3. if (response.content() != null && response.content().refCnt() > 0) {
  4. response.content().release();
  5. }
  6. }
  7. })

相关文章