Package de.aristaflow.adept2.util
Class ArrayTools.ByteArrayWrapper
java.lang.Object
de.aristaflow.adept2.util.ArrayTools.ByteArrayWrapper
- Enclosing class:
- ArrayTools
A wrapper for byte arrays that provide a useful (i. e. deep)
Equality requires the objects to be compared to be
equals(Object),
hashCode() and toString(). Equality requires the objects to be compared to be
ByteArrayWrapper. Only then the
arrays will be unwrapped and compared. Comparing a ByteArrayWrapper with a normal
byte array will yield false.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionByteArrayWrapper(byte[] array) Creates a new wrapped array for designated array. -
Method Summary
-
Field Details
-
array
protected final byte[] arrayThe wrapped array.
-
-
Constructor Details
-
ByteArrayWrapper
public ByteArrayWrapper(byte[] array) Creates a new wrapped array for designated array. This does not clone the array, so beware of side-effects! Changing elements of the array will also change the implementedhashCode()andequals(Object).- Parameters:
array- The array to be wrapped. This does not clone the array, so beware of side-effects!
-
-
Method Details
-
getArray
public byte[] getArray()Gets the wrapped array. This is not a clone, so beware of side-effects! Changing elements of the array will also change the implementedhashCode()andequals(Object).- Returns:
- The wrapped array. This is not a clone, so beware of side-effects!
-
equals
-
hashCode
public int hashCode() -
toString
-