/**
* Returns a {@link StreamDataFileIndexIterator} for iterating over all (timestamp, position) pairs.
*/
StreamDataFileIndexIterator indexIterator() {
final LongListIterator timestampIter = timestamps.iterator();
final LongListIterator positionIter = positions.iterator();
return new StreamDataFileIndexIterator() {
private long timestamp;
private long position;
@Override
public boolean nextIndexEntry() {
if (timestampIter.hasNext() && positionIter.hasNext()) {
timestamp = timestampIter.nextLong();
position = positionIter.nextLong();
return true;
}
return false;
}