示例#1
0
 @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);
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
 @Override
 public int hashCode() {
   if (hash == 0) {
     hash = Utils.getByteArrayHash(value);
   }
   return hash;
 }
示例#4
0
 @Override
 public byte[] getBytes() {
   return Utils.cloneByteArray(getBytesNoCopy());
 }