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

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

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

ByteBuf.equals介绍

[英]Determines if the content of the specified buffer is identical to the content of this array. 'Identical' here means:

  • the size of the contents of the two buffers are same and
  • every single byte of the content of the two buffers are same.
    Please note that it does not compare #readerIndex() nor #writerIndex(). This method also returns false for null and an object which is not an instance of ByteBuf type.
    [中]确定指定缓冲区的内容是否与此数组的内容相同。'“相同”在这里是指:
    *两个缓冲区的内容大小相同,并且
    *两个缓冲区内容的每个字节都是相同的。
    请注意,它不比较#readerIndex()和#writeridex()。对于null和不是ByteBuf类型实例的对象,此方法还返回false。

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Override
public boolean equals(Object other) {
  return (this == other || (other instanceof NettyDataBuffer &&
      this.byteBuf.equals(((NettyDataBuffer) other).byteBuf)));
}

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

@Override
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
public boolean equals(Object obj) {
  return buf.equals(obj);
}

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

@Override
public boolean equals(Object o) {
  if (o == this) {
    return true;
  } else if (!(o instanceof PemX509Certificate)) {
    return false;
  }
  PemX509Certificate other = (PemX509Certificate) o;
  return content.equals(other.content);
}

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

@Override
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
public boolean equals(Object obj) {
  return buf.equals(obj);
}

代码示例来源:origin: org.springframework/spring-core

@Override
public boolean equals(Object other) {
  return (this == other || (other instanceof NettyDataBuffer &&
      this.byteBuf.equals(((NettyDataBuffer) other).byteBuf)));
}

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

@Override
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
public boolean equals(Object obj) {
  return buf.equals(obj);
}

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

@Override
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
public boolean equals(Object obj) {
  return byteBuf.equals(obj);
}

代码示例来源:origin: eclipse-vertx/vert.x

@Override
public boolean equals(Object o) {
 if (this == o) return true;
 if (o == null || getClass() != o.getClass()) return false;
 BufferImpl buffer1 = (BufferImpl) o;
 return buffer != null ? buffer.equals(buffer1.buffer) : buffer1.buffer == null;
}

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

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o instanceof ByteBufHolder) {
    return data.equals(((ByteBufHolder) o).content());
  }
  return false;
}

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

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o instanceof ByteBufHolder) {
    return data.equals(((ByteBufHolder) o).content());
  }
  return false;
}

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

private boolean isEquals(Object value, Object oldValue) {
  ByteBuf valueBuf = encode(value);
  ByteBuf oldValueBuf = encode(oldValue);
  
  try {
    return valueBuf.equals(oldValueBuf);
  } finally {
    valueBuf.readableBytes();
    oldValueBuf.readableBytes();
  }
}

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

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o instanceof ByteBufHolder) {
    return data.equals(((ByteBufHolder) o).content());
  }
  return false;
}

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

private boolean isEquals(Object value, Object oldValue) {
  ByteBuf valueBuf = encode(value);
  ByteBuf oldValueBuf = encode(oldValue);
  
  try {
    return valueBuf.equals(oldValueBuf);
  } finally {
    valueBuf.readableBytes();
    oldValueBuf.readableBytes();
  }
}

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

private boolean isEqual(Object value, Object oldValue) {
  ByteBuf valueBuf = ((RedissonObject)map).encodeMapValue(value);
  ByteBuf oldValueBuf = ((RedissonObject)map).encodeMapValue(oldValue);
  
  try {
    return valueBuf.equals(oldValueBuf);
  } finally {
    valueBuf.readableBytes();
    oldValueBuf.readableBytes();
  }
}

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

private boolean isEqual(Object value, Object oldValue) {
  ByteBuf valueBuf = ((RedissonObject)map).encodeMapValue(value);
  ByteBuf oldValueBuf = ((RedissonObject)map).encodeMapValue(oldValue);
  
  try {
    return valueBuf.equals(oldValueBuf);
  } finally {
    valueBuf.readableBytes();
    oldValueBuf.readableBytes();
  }
}

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

private boolean isEqual(Object value, Object oldValue) {
  ByteBuf valueBuf = ((RedissonObject)set).encode(value);
  ByteBuf oldValueBuf = ((RedissonObject)set).encode(oldValue);
  
  try {
    return valueBuf.equals(oldValueBuf);
  } finally {
    valueBuf.readableBytes();
    oldValueBuf.readableBytes();
  }
}

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

private boolean isEqual(Object value, Object oldValue) {
  ByteBuf valueBuf = ((RedissonObject)set).encode(value);
  ByteBuf oldValueBuf = ((RedissonObject)set).encode(oldValue);
  
  try {
    return valueBuf.equals(oldValueBuf);
  } finally {
    valueBuf.readableBytes();
    oldValueBuf.readableBytes();
  }
}

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

@Override
public boolean equals(Object o) {
  if (!(o instanceof DefaultHttp2DataFrame)) {
    return false;
  }
  DefaultHttp2DataFrame other = (DefaultHttp2DataFrame) o;
  return super.equals(other) && content.equals(other.content())
    && endStream == other.endStream && padding == other.padding;
}

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

@Override
public boolean equals(Object o) {
  if (!(o instanceof DefaultFullHttpResponse)) {
    return false;
  }
  DefaultFullHttpResponse other = (DefaultFullHttpResponse) o;
  return super.equals(other) &&
      content().equals(other.content()) &&
      trailingHeaders().equals(other.trailingHeaders());
}

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

@Override
public boolean equals(Object o) {
  if (!(o instanceof DefaultFullHttpRequest)) {
    return false;
  }
  DefaultFullHttpRequest other = (DefaultFullHttpRequest) o;
  return super.equals(other) &&
      content().equals(other.content()) &&
      trailingHeaders().equals(other.trailingHeaders());
}

相关文章

ByteBuf类方法