| Modifier and Type | Field and Description |
|---|---|
| public byte[] | |
| public boolean | |
| public int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ByteArray(boolean
If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy. ordered, int Any elements added beyond this will cause the backing array to be grown. capacity)
|
| public | |
| public | |
| public | ByteArray(boolean
If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy. ordered, byte[] array, int startIndex, int count)Creates a new array containing the elements in the specified array. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public byte[] | Returns: itemsIncreases the size of the backing array to accommodate the specified number of additional items. |
| public boolean | |
| public byte | |
| public byte | |
| public int | |
| public void | |
| public void | |
| public int | |
| public void | |
| public void | |
| public boolean | |
| public int | |
| public void | |
| public void | |
| public boolean | |
| public byte | |
| public byte | |
| public byte | |
| public boolean | |
| public int | |
| public void | |
| public boolean | |
| public int | Returns: the number of replacements donethe byte to be replaced value, byte all occurrences of value will be replaced by this replacement replacement)Returns the number of replacements done. |
| public boolean | Returns: if value was found and replacedthe byte to be replaced value, byte the first value will be replaced by this replacement if found replacement)Returns true if the specified value was replaced successfully with the replacement |
| protected byte[] | |
| public void | |
| public void | |
| public byte[] | |
| public byte[] | |
| public void | |
| public void | |
| public void | |
| public byte[] | |
| public String | |
| public String | |
| public void | |
| public static ByteArray |
| items | back to summary |
|---|---|
| public byte[] items | |
| ordered | back to summary |
|---|---|
| public boolean ordered | |
| size | back to summary |
|---|---|
| public int size | |
| ByteArray | back to summary |
|---|---|
| public ByteArray() Creates an ordered array with a capacity of 16. | |
| ByteArray | back to summary |
|---|---|
| public ByteArray(int capacity) Creates an ordered array with the specified capacity. | |
| ByteArray | back to summary |
|---|---|
public ByteArray(boolean ordered, int capacity)
| |
| ByteArray | back to summary |
|---|---|
| public ByteArray(ByteArray array) Creates a new array containing the elements in the specific array. The new array will be ordered if the specific array is ordered. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be grown. | |
| ByteArray | back to summary |
|---|---|
| public ByteArray(byte[] array) Creates a new ordered array containing the elements in the specified array. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be grown. | |
| ByteArray | back to summary |
|---|---|
| public ByteArray(boolean ordered, byte[] array, int startIndex, int count) Creates a new array containing the elements in the specified array. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be grown.
| |
| add | back to summary |
|---|---|
| public void add(byte value) | |
| add | back to summary |
|---|---|
| public void add(byte value1, byte value2) | |
| add | back to summary |
|---|---|
| public void add(byte value1, byte value2, byte value3) | |
| add | back to summary |
|---|---|
| public void add(byte value1, byte value2, byte value3, byte value4) | |
| addAll | back to summary |
|---|---|
| public void addAll(ByteArray array) | |
| addAll | back to summary |
|---|---|
| public void addAll(ByteArray array, int offset, int length) | |
| addAll | back to summary |
|---|---|
| public void addAll(byte... array) | |
| addAll | back to summary |
|---|---|
| public void addAll(byte[] array, int offset, int length) | |
| clear | back to summary |
|---|---|
| public void clear() | |
| contains | back to summary |
|---|---|
| public boolean contains(byte value) | |
| ensureCapacity | back to summary |
|---|---|
| public byte[] ensureCapacity(int additionalCapacity) Increases the size of the backing array to accommodate the specified number of additional items. Useful before adding many items to avoid multiple backing array resizes.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Returns false if either array is unordered. | |
| first | back to summary |
|---|---|
| public byte first() Returns the first item. | |
| get | back to summary |
|---|---|
| public byte get(int index) | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| incr | back to summary |
|---|---|
| public void incr(int index, byte value) | |
| incr | back to summary |
|---|---|
| public void incr(byte value) | |
| indexOf | back to summary |
|---|---|
| public int indexOf(byte value) | |
| insert | back to summary |
|---|---|
| public void insert(int index, byte value) | |
| insertRange | back to summary |
|---|---|
| public void insertRange(int index, int count) Inserts the specified number of items at the specified index. The new items will have values equal to the values at those indices before the insertion. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns true if the array is empty. | |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(byte value) | |
| mul | back to summary |
|---|---|
| public void mul(int index, byte value) | |
| mul | back to summary |
|---|---|
| public void mul(byte value) | |
| notEmpty | back to summary |
|---|---|
| public boolean notEmpty() Returns true if the array has one or more items. | |
| peek | back to summary |
|---|---|
| public byte peek() Returns the last item. | |
| pop | back to summary |
|---|---|
| public byte pop() Removes and returns the last item. | |
| random | back to summary |
|---|---|
| public byte random() Returns a random item from the array, or zero if the array is empty. | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(ByteArray array) Removes from this array the first instance of each element contained in the specified array.
| |
| removeIndex | back to summary |
|---|---|
| public int removeIndex(int index) Removes and returns the item at the specified index. | |
| removeRange | back to summary |
|---|---|
| public void removeRange(int start, int end) Removes the items between the specified indices, inclusive. | |
| removeValue | back to summary |
|---|---|
| public boolean removeValue(byte value) | |
| replaceAll | back to summary |
|---|---|
| public int replaceAll(byte value, byte replacement) Returns the number of replacements done.
| |
| replaceFirst | back to summary |
|---|---|
| public boolean replaceFirst(byte value, byte replacement) Returns true if the specified value was replaced successfully with the replacement
| |
| resize | back to summary |
|---|---|
| protected byte[] resize(int newSize) | |
| reverse | back to summary |
|---|---|
| public void reverse() | |
| set | back to summary |
|---|---|
| public void set(int index, byte value) | |
| setSize | back to summary |
|---|---|
| public byte[] setSize(int newSize) Sets the array size, leaving any values beyond the current size undefined.
| |
| shrink | back to summary |
|---|---|
| public byte[] shrink() Reduces the size of the backing array to the size of the actual items. This is useful to release memory when many items have been removed, or if it is known that more items will not be added.
| |
| shuffle | back to summary |
|---|---|
| public void shuffle() | |
| sort | back to summary |
|---|---|
| public void sort() | |
| swap | back to summary |
|---|---|
| public void swap(int first, int second) | |
| toArray | back to summary |
|---|---|
| public byte[] toArray() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| toString | back to summary |
|---|---|
| public String toString(String separator) | |
| truncate | back to summary |
|---|---|
| public void truncate(int newSize) Reduces the size of the array to the specified size. If the array is already smaller than the specified size, no action is taken. | |
| with | back to summary |
|---|---|
public static ByteArray with(byte... array)
| |