public virtual bool Next()
        {
            while (true)
            {
                if (count == df)
                {
                    return(false);
                }

                int docCode = freqStream.ReadVInt();
                doc += (int)(((uint)docCode) >> 1); // shift off low bit
                if ((docCode & 1) != 0)
                {
                    // if low bit is set
                    freq = 1;
                }
                // freq is one
                else
                {
                    freq = freqStream.ReadVInt(); // else read freq
                }
                count++;

                if (deletedDocs == null || !deletedDocs.Get(doc))
                {
                    break;
                }
                SkippingDoc();
            }
            return(true);
        }
 public override bool IsDeleted(int n)
 {
     lock (this)
     {
         return(deletedDocs != null && deletedDocs.Get(n));
     }
 }