{
BitIndexPointer pointer = new SimpleBitIndexPointer();
pointer.setOffset(output.getByteOffset(), output.getBitOffset());
int numberOfEntries = 0;
Posting posting = null;
while(iterator.hasNext())
{
posting = iterator.next();
output.writeGamma(posting.getId() - previousId);
previousId = posting.getId();
writePostingNotDocid(posting);
numberOfEntries++;
}
pointer.setNumberOfEntries(numberOfEntries);
return pointer;