//obtain the compressed memory posting list
final MemorySBOS Docs = p.getDocs();
//some obscure problem when reading from memory rather than disk.
//by padding the posting list with some non zero bytes the problem
//is solved. Thanks to Roicho for working this one out.
Docs.writeGamma(1);
Docs.writeGamma(1);
Docs.pad();
//use a PostingInRun to decompress the postings stored in memory
final PostingInRun pir = getPostingReader();