/** {@inheritDoc} */ @Override public boolean equals(Object other) { if (other == this) return true; if (!(other instanceof BinaryObject)) return false; BinaryIdentityResolver identity = context().identity(typeId()); return identity.equals(this, (BinaryObject)other); }
/** * Convert binary object to it's final state. * * @param obj Object. * @param offheap Offheap flag. * @return Result. */ private BinaryObjectExImpl convert(BinaryObjectExImpl obj, boolean offheap) { if (offheap) { byte[] arr = obj.array(); long ptr = GridUnsafe.allocateMemory(arr.length); ptrs.add(ptr); GridUnsafe.copyMemory(arr, GridUnsafe.BYTE_ARR_OFF, null, ptr, arr.length); obj = new BinaryObjectOffheapImpl(obj.context(), ptr, 0, obj.array().length); } return obj; }
/** * Convert binary object to it's final state. * * @param obj Object. * @param offheap Offheap flag. * @return Result. */ private BinaryObjectExImpl convert(BinaryObject obj, boolean offheap) { BinaryObjectExImpl obj0 = (BinaryObjectExImpl)obj; if (offheap) { byte[] arr = obj0.array(); long ptr = GridUnsafe.allocateMemory(arr.length); ptrs.add(ptr); GridUnsafe.copyMemory(arr, GridUnsafe.BYTE_ARR_OFF, null, ptr, arr.length); obj0 = new BinaryObjectOffheapImpl(obj0.context(), ptr, 0, obj0.array().length); } return obj0; }
/** {@inheritDoc} */ @Override public boolean equals(Object other) { if (other == this) return true; if (!(other instanceof BinaryObject)) return false; BinaryIdentityResolver identity = context().identity(typeId()); return identity.equals(this, (BinaryObject)other); }