use of net.openhft.chronicle.core.annotation.Java9 in project Chronicle-Bytes by OpenHFT.
the class VanillaBytes method isEqual0.
@Java9
private static boolean isEqual0(@NotNull byte[] bytes, byte coder, @NotNull NativeBytesStore bs, long address) {
@Nullable Memory memory = bs.memory;
if (coder == 0) {
int i = 0;
for (; i < bytes.length; i++) {
byte b = memory.readByte(address + i);
char c = (char) (bytes[i] & 0xFF);
if (b != c) {
return false;
}
}
} else {
int i = 0;
for (; i < bytes.length; i++) {
byte b = memory.readByte(address + i);
char c = (char) (((bytes[i + 1] & 0xFF) << 8) | (bytes[i] & 0xFF));
if (b != c) {
return false;
}
}
}
return true;
}