Package org.drasyl.util
Class ImmutableByteArray
- java.lang.Object
-
- org.drasyl.util.ImmutableByteArray
-
public final class ImmutableByteArray extends Object
Immutable byte array implementation, that do not allow any modifications to the original input.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
byte[]
getArray()
int
hashCode()
boolean
isEmpty()
static ImmutableByteArray
of(byte[] array)
Copy the givenarray
and stores it as immutable object.int
size()
String
toString()
-
-
-
Method Detail
-
of
public static ImmutableByteArray of(byte[] array)
Copy the givenarray
and stores it as immutable object.- Parameters:
array
- the array to copy- Returns:
- an immutable byte array
-
getArray
public byte[] getArray()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
-