@Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; return ByteUtil.equals(data, s.data); } else { return false; } }
public static boolean equals(final byte[] left, final byte[] right, final int rightOffset, final int rightLength) { if (left == right) return true; if (left == null || right == null) return false; if (left.length != rightLength) return false; if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { return equalsUnsafe(left, right, rightOffset, rightLength); } else { return equalsSafe(left, right, rightOffset, rightLength); } }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public static boolean equals(final byte[] bytes, final ByteBuf byteBuf, final int offset, final int length) { if (bytes.length != length) return false; if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { if ((offset + length) > byteBuf.writerIndex()) { throw new IndexOutOfBoundsException(); } if (byteBuf.hasArray()) { return equals(bytes, byteBuf.array(), byteBuf.arrayOffset() + offset, length); } else if (byteBuf.hasMemoryAddress()) { return equalsOffHeap(bytes, byteBuf.memoryAddress(), offset, length); } } return equalsOnHeap(bytes, byteBuf, offset, length); }
public static boolean equals(final byte[] left, final byte[] right, final int rightOffset, final int rightLength) { if (left == right) return true; if (left == null || right == null) return false; if (left.length != rightLength) return false; if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { return equalsUnsafe(left, right, rightOffset, rightLength); } else { return equalsSafe(left, right, rightOffset, rightLength); } }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); }
public static boolean equals(final byte[] left, final byte[] right, final int rightOffset, final int rightLength) { if (left == right) return true; if (left == null || right == null) return false; if (left.length != rightLength) return false; if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { return equalsUnsafe(left, right, rightOffset, rightLength); } else { return equalsSafe(left, right, rightOffset, rightLength); } }
@Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; return ByteUtil.equals(data, s.data); } else { return false; } }
public static boolean equals(final byte[] left, final byte[] right, final int rightOffset, final int rightLength) { if (left == right) return true; if (left == null || right == null) return false; if (left.length != rightLength) return false; if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { return equalsUnsafe(left, right, rightOffset, rightLength); } else { return equalsSafe(left, right, rightOffset, rightLength); } }
@Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; return ByteUtil.equals(data, s.data); } else { return false; } }
public static boolean equals(final byte[] left, final byte[] right, final int rightOffset, final int rightLength) { if (left == right) return true; if (left == null || right == null) return false; if (left.length != rightLength) return false; if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { return equalsUnsafe(left, right, rightOffset, rightLength); } else { return equalsSafe(left, right, rightOffset, rightLength); } }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); }
@Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; return ByteUtil.equals(data, s.data); } else { return false; } }
@Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; return ByteUtil.equals(data, s.data); } else { return false; } }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); }
@Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; return ByteUtil.equals(data, s.data); } else { return false; } }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); }
@Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; return ByteUtil.equals(data, s.data); } else { return false; } }
/** * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. * <p> * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the * length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); }