@Override public boolean isEqual(String s) { if (s == null || s.length() != readRemaining()) return false; char[] chars = StringUtils.extractChars(s); if (bytesStore instanceof NativeBytesStore) { NativeBytesStore bs = (NativeBytesStore) this.bytesStore; long address = bs.address + bs.translate(readPosition); Memory memory = bs.memory; for (int i = 0; i < chars.length; i++) { int b = memory.readByte(address + i) & 0xFF; if (b != chars[i]) return false; } } else { try { for (int i = 0; i < chars.length; i++) { int b = bytesStore.readByte(readPosition + i) & 0xFF; if (b != chars[i]) return false; } } catch (IORuntimeException e) { throw new AssertionError(e); } } return true; }