io.netty.buffer.ByteBuf.discardSomeReadBytes()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(298)

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

ByteBuf.discardSomeReadBytes介绍

[英]Similar to ByteBuf#discardReadBytes() except that this method might discard some, all, or none of read bytes depending on its internal implementation to reduce overall memory bandwidth consumption at the cost of potentially additional memory consumption.
[中]与ByteBuf#discardReadBytes()类似,不同之处在于此方法可能会丢弃部分、全部或任何读取字节,具体取决于其内部实现,从而以潜在的额外内存消耗为代价降低总体内存带宽消耗。

代码示例

代码示例来源:origin: netty/netty

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

代码示例来源:origin: netty/netty

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

代码示例来源:origin: redisson/redisson

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

代码示例来源:origin: redisson/redisson

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

代码示例来源:origin: wildfly/wildfly

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

代码示例来源:origin: wildfly/wildfly

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

代码示例来源:origin: micronaut-projects/micronaut-core

@Override
public ByteBuf discardSomeReadBytes() {
  byteBuf.discardSomeReadBytes();
  return this;
}

代码示例来源:origin: netty/netty

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: redisson/redisson

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: wildfly/wildfly

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: alipay/sofa-bolt

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: io.netty/netty-buffer

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

代码示例来源:origin: io.netty/netty-buffer

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

代码示例来源:origin: ProtocolSupport/ProtocolSupport

@Override
public ByteBuf discardSomeReadBytes() {
  buffer.discardSomeReadBytes();
  return this;
}

代码示例来源:origin: io.ratpack/ratpack-core

@Override
public ByteBuf discardSomeReadBytes() {
 delegate.discardSomeReadBytes();
 return this;
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

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

代码示例来源:origin: apache/activemq-artemis

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

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

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: apache/activemq-artemis

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: io.netty/netty-codec

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();
  }
}

相关文章

ByteBuf类方法