// Using direct buffers is the fastest way to iterate in Hppc, see: http://labs.carrotsearch.com/hppc-api-and-code-examples.html#example-code

```java
            boolean[] allocated = terms.allocated;
            Object[] keys = terms.keys;
            for (int i = 0; i < allocated.length; i++) {
                if (allocated[i]) {
                    BytesRef key = (BytesRef) keys[i];
                    out.writeBytesRef(key);
                }
            }
```