Returns an array with all elements and invalidates the internal array. Warning: the function must only be called if the list is discarded afterward. @return array (internal representation!)
()
| 107 | * @return array (internal representation!) |
| 108 | */ |
| 109 | public byte[] finish() { |
| 110 | final byte[] lst = list; |
| 111 | list = null; |
| 112 | final int s = size; |
| 113 | return s == 0 ? EMPTY : s == lst.length ? lst : Arrays.copyOf(lst, s); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Reverses the order of the elements. |