IntArraypublic final class UnsignedByteArray extends java.lang.Object implements IntArray
Class ShiftedByteIndexArray represents an immutable
array of integer values between 0 and 255 inclusive that is stored
as a byte[] array whose values have been translated by -128.
Instances of UnsignedByteArray are immutable.
| Constructor | Description |
|---|---|
UnsignedByteArray(byte[] ba) |
Constructs a new
UnsignedByteArray instance from
the specified data. |
UnsignedByteArray(byte[] ba,
int from,
int to) |
Constructs a new
UnsignedByteArray instance from the
specified data. |
UnsignedByteArray(int[] ia) |
Constructs a new
UnsignedByteArray instance from
the specified data. |
UnsignedByteArray(int[] ia,
int valueSize) |
Constructs a new
UnsignedByteArray instance from
the specified data. |
UnsignedByteArray(int[] ia,
int from,
int to) |
Constructs a new
UnsignedByteArray instance from the
specified data. |
UnsignedByteArray(IntList il) |
Constructs a new
UnsignedByteArray instance from the specified data. |
UnsignedByteArray(IntList il,
int valueSize) |
Constructs a new
UnsignedByteArray instance from
the specified data. |
UnsignedByteArray(IntList il,
int from,
int to) |
Constructs a new
UnsignedByteArray instance from the
specified data. |
| Modifier and Type | Method | Description |
|---|---|---|
int |
get(int index) |
Returns the specified array element.
|
int |
size() |
Returns the number of elements in this
IntArray. |
java.lang.String |
toString() |
public UnsignedByteArray(byte[] ba)
UnsignedByteArray instance from
the specified data.ba - an array of bytes which are interpreted as unsigned byte
values between 0 and 255java.lang.NullPointerException - if ba == nullpublic UnsignedByteArray(byte[] ba,
int from,
int to)
UnsignedByteArray instance from the
specified data.ba - an array of bytes which are interpreted as unsigned byte
values between 0 and 255from - the first element to be included (inclusive)to - the last element to be included (exclusive)java.lang.IndexOutOfBoundsException - if (from < 0 || to > ia.length)java.lang.NegativeArraySizeException - if to > fromjava.lang.NullPointerException - if ba == nullpublic UnsignedByteArray(int[] ia)
UnsignedByteArray instance from
the specified data.ia - an array of positive integer values whose lower order byte
will be storedjava.lang.IllegalArgumentException - if
(ia[j] < 0 || ia[j] > 255) for any index j
satisfying (j >= 0 && j < ia.length)java.lang.NullPointerException - if ia == nullpublic UnsignedByteArray(IntList il)
UnsignedByteArray instance from the specified data.il - an list of integer values between 0 and 255 inclusivejava.lang.IllegalArgumentException - if
(il.get(j) < 0 || il.get(j) > 255) for any index j
satisfying (j >= 0 && j < il.size())java.lang.NullPointerException - if il == nullpublic UnsignedByteArray(int[] ia,
int valueSize)
UnsignedByteArray instance from
the specified data.ia - an array of nonnegative integer valuesvalueSize - the exclusive end of the range of non-negative
array valuesjava.lang.IllegalArgumentException - if valueSize < 1 || valueSize > 256java.lang.IllegalArgumentException - if
(ia[j] < 0 || ia[j] > valueSize) for any index j
satisfying (j >= 0 && j < ia.length)java.lang.NullPointerException - if ia == nullpublic UnsignedByteArray(IntList il, int valueSize)
UnsignedByteArray instance from
the specified data.il - an list of nonnegative integersvalueSize - the exclusive end of the range of non-negative
array valuesjava.lang.IllegalArgumentException - if
(valueSize < 1) || (valueSize > 256)java.lang.IllegalArgumentException - if
(ia[j] < 0 || ia[j] > valueSize) for any index j
satisfying (j >= 0 && j < ia.length)java.lang.NullPointerException - if il == nullpublic UnsignedByteArray(int[] ia,
int from,
int to)
UnsignedByteArray instance from the
specified data.ia - an array of integer values between 0 and 255 inclusivefrom - the first element to be included (inclusive)to - the last element to be included (exclusive)java.lang.IllegalArgumentException - if
(ia[j] < 0 || ia[j] > 255) for any index j
satisfying (j >= from && j < to)java.lang.IndexOutOfBoundsException - if (from < 0 || to > ia.length)java.lang.NegativeArraySizeException - if to > fromjava.lang.NullPointerException - if ia == nullpublic UnsignedByteArray(IntList il, int from, int to)
UnsignedByteArray instance from the
specified data.il - an list of integer values between 0 and 255 inclusivefrom - the first element to be included (inclusive)to - the last element to be included (exclusive)java.lang.IllegalArgumentException - if
(il.get(j) < 0 || il.get(j) > 255) for any index j
satisfying (j >= from && j < to)java.lang.IndexOutOfBoundsException - if from < 0 || to > il.lengthjava.lang.NegativeArraySizeException - if to > fromjava.lang.NullPointerException - if il == nullpublic int size()
IntArrayIntArray.public int get(int index)
IntArraypublic java.lang.String toString()
toString in class java.lang.Object