The word array used to store the bits. The array is shrunk to the last word, where a bit is set. @return array of longs
()
| 60 | * @return array of longs |
| 61 | */ |
| 62 | public long[] toArray() { |
| 63 | // find the last index of a word which is different from 0 |
| 64 | int i = words.length; |
| 65 | while(--i >= 0 && words[i] == 0); |
| 66 | return Arrays.copyOf(words, ++i); |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Returns the number of bits set to {@code true}. |