@Override protected int compareSecure(Value v, CompareMode mode) { byte[] v2 = ((ValueBytes) v).value; if (mode.isBinaryUnsigned()) { return Utils.compareNotNullUnsigned(value, v2); } return Utils.compareNotNullSigned(value, v2); }
/** * Get or create a bytes value for the given byte array. Clone the data. * * @param b the byte array * @return the value */ public static ValueBytes get(byte[] b) { if (b.length == 0) { return EMPTY; } b = Utils.cloneByteArray(b); return getNoCopy(b); }
@Override public int hashCode() { if (hash == 0) { hash = Utils.getByteArrayHash(value); } return hash; }
@Override public byte[] getBytes() { return Utils.cloneByteArray(getBytesNoCopy()); }