Adds an element to the array. @param element element to be added; will be cast to a byte @return self reference
(final int element)
| 37 | * @return self reference |
| 38 | */ |
| 39 | public ByteList add(final int element) { |
| 40 | byte[] lst = list; |
| 41 | final int s = size; |
| 42 | if(s == lst.length) { |
| 43 | lst = Arrays.copyOf(lst, newCapacity()); |
| 44 | list = lst; |
| 45 | } |
| 46 | lst[s] = (byte) element; |
| 47 | size = s + 1; |
| 48 | return this; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Adds elements to the container. |