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

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

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

ByteBuf.compareTo介绍

暂无

代码示例

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

@Override
public int compareTo(ByteBuf buffer) {
  return buf.compareTo(buffer);
}

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

@Override
public int compareTo(ByteBuf buffer) {
  return buf.compareTo(buffer);
}

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

@Override
public int compareTo(ByteBuf buffer) {
  return buf.compareTo(buffer);
}

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

@Override
public int compareTo(ByteBuf buffer) {
  return byteBuf.compareTo(buffer);
}

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

@Override
public int compareTo(ByteBuf buffer) {
  return buf.compareTo(buffer);
}

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

@Override
public int compareTo(ByteBuf buffer) {
  return buf.compareTo(buffer);
}

代码示例来源:origin: Dytanic/CloudNet

@Override
public int compareTo(ByteBuf byteBuf)
{
  return byteBuf.compareTo(byteBuf);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public int compareTo(ByteBuf buffer) {
  return buf.compareTo(buffer);
}

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

@Override
public int compareTo(final ByteBuf byteBuf) {
  return this.buf.compareTo(byteBuf);
}

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

@Override
public int compareTo(ByteBuf buffer) {
 return delegate.compareTo(buffer);
}

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

@Override
public int compareTo(ByteBuf buffer) {
  return buf.compareTo(buffer);
}

代码示例来源:origin: org.apache.bookkeeper/bookkeeper-server

public long verifyDigestAndReturnLac(ByteBuf dataReceived) throws BKDigestMatchException{
  if ((LAC_METADATA_LENGTH + macCodeLength) > dataReceived.readableBytes()) {
    logger.error("Data received is smaller than the minimum for this digest type."
        + " Either the packet it corrupt, or the wrong digest is configured. "
        + " Digest type: {}, Packet Length: {}",
        this.getClass().getName(), dataReceived.readableBytes());
    throw new BKDigestMatchException();
  }
  update(dataReceived.slice(0, LAC_METADATA_LENGTH));
  ByteBuf digest = allocator.buffer(macCodeLength);
  try {
    populateValueAndReset(digest);
    if (digest.compareTo(dataReceived.slice(LAC_METADATA_LENGTH, macCodeLength)) != 0) {
      logger.error("Mac mismatch for ledger-id LAC: " + ledgerId);
      throw new BKDigestMatchException();
    }
  } finally {
    digest.release();
  }
  long actualLedgerId = dataReceived.readLong();
  long lac = dataReceived.readLong();
  if (actualLedgerId != ledgerId) {
    logger.error("Ledger-id mismatch in authenticated message, expected: " + ledgerId + " , actual: "
           + actualLedgerId);
    throw new BKDigestMatchException();
  }
  return lac;
}

代码示例来源:origin: longkerdandy/mithqtt

private static void validatePublishPayload(ByteBuf expected, ByteBuf actual) {
  assertEquals("PublishPayload mismatch ", 0, expected.compareTo(actual));
}

代码示例来源:origin: org.apache.bookkeeper/bookkeeper-server

if (digest.compareTo(dataReceived.slice(METADATA_LENGTH, macCodeLength)) != 0) {
  logger.error("Mac mismatch for ledger-id: " + ledgerId + ", entry-id: " + entryId);
  throw new BKDigestMatchException();

代码示例来源:origin: org.apache.bookkeeper/statelib

cmp = record.getValue().compareTo(Unpooled.wrappedBuffer(rawValue));
} else {

相关文章

ByteBuf类方法