org.sdnplatform.sync.internal.util
Class ByteArray
java.lang.Object
org.sdnplatform.sync.internal.util.ByteArray
- All Implemented Interfaces:
- java.io.Serializable
public final class ByteArray
- extends java.lang.Object
- implements java.io.Serializable
A byte array container that provides an equals and hashCode pair based on the
contents of the byte array. This is useful as a key for Maps.
- See Also:
- Serialized Form
Constructor Summary |
ByteArray(byte... underlying)
|
Method Summary |
boolean |
equals(java.lang.Object obj)
|
byte[] |
get()
|
int |
hashCode()
|
int |
length()
|
static java.lang.Iterable<java.lang.String> |
toHexStrings(java.lang.Iterable<ByteArray> arrays)
Translate the each ByteArray in an iterable into a hexidecimal string |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
EMPTY
public static final ByteArray EMPTY
ByteArray
public ByteArray(byte... underlying)
get
public byte[] get()
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toHexStrings
public static java.lang.Iterable<java.lang.String> toHexStrings(java.lang.Iterable<ByteArray> arrays)
- Translate the each ByteArray in an iterable into a hexidecimal string
- Parameters:
arrays
- The array of bytes to translate
- Returns:
- An iterable of converted strings
length
public int length()