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

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

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

@Override
public int refCnt() {
  return content.refCnt();
}

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

@Override
public final int refCnt() {
  return buf.refCnt();
}

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

@Override
public int refCnt() {
  return content.refCnt();
}

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

@Override
public int refCnt() {
  return content.refCnt();
}

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

@Override
public int refCnt() {
  return content.refCnt();
}

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

@Override
public int refCnt() {
  return content.refCnt();
}

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

@Override
public ByteBuf content() {
  if (data.refCnt() <= 0) {
    throw new IllegalReferenceCountException(data.refCnt());
  }
  return data;
}

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

@Override
public ByteBuf content() {
  if (data.refCnt() <= 0) {
    throw new IllegalReferenceCountException(data.refCnt());
  }
  return data;
}

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

@Override
public ByteBuf content() {
  if (data.refCnt() <= 0) {
    throw new IllegalReferenceCountException(data.refCnt());
  }
  return data;
}

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

@Override
  public void call(ByteBuf byteBuf) {
    if (byteBuf != null && byteBuf.refCnt() > 0) {
      byteBuf.release();
    }
  }
};

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

private void releaseResponseContent() {
  if (responseContent != null && responseContent.refCnt() > 0) {
    responseContent.release();
  }
  responseContent = null;
}

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

/**
 * If it is still present and open, release the content buffer. Also set it
 * to null so that next decoding can take a new buffer from the pool.
 */
private void releaseResponseContent() {
  if (responseContent != null) {
    if (responseContent.refCnt() > 0) {
      responseContent.release();
    }
    responseContent = null;
  }
}

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

@Override
  public void call(ByteBuf byteBuf) {
    if (byteBuf != null && byteBuf.refCnt() > 0) {
      byteBuf.release();
    }
  }
};

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

/**
 * If it is still present and open, release the content buffer. Also set it
 * to null so that next decoding can take a new buffer from the pool.
 */
private void releaseResponseContent() {
  if (responseContent != null) {
    if (responseContent.refCnt() > 0) {
      responseContent.release();
    }
    responseContent = null;
  }
}

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

private void releaseResponseContent() {
  if (responseContent != null && responseContent.refCnt() > 0) {
    responseContent.release();
  }
  responseContent = null;
}

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

private void releaseResponseContent() {
  if (responseContent != null && responseContent.refCnt() > 0) {
    responseContent.release();
  }
  responseContent = null;
}

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

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

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

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

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

private static void releaseAll(List<ByteBuf> byteBufs) {
  for (ByteBuf byteBuf : byteBufs) {
    if (byteBuf != null && byteBuf.refCnt() > 0) {
      byteBuf.release();
    }
  }
}

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

@Override
  public void call(UpsertResponse response) {
    if (response.content() != null && response.content().refCnt() > 0) {
      response.content().release();
    }
  }
})

相关文章