Lucene.Net.Store.DataOutput.WriteVLong C# (CSharp) Method

WriteVLong() public method

Writes an long in a variable-length format. Writes between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

The format is described further in DataOutput#writeVInt(int).

public WriteVLong ( long i ) : void
i long
return void
        public void WriteVLong(long i)
        {
            Debug.Assert(i >= 0L);
            while ((i & ~0x7FL) != 0L)
            {
                WriteByte((byte)unchecked((sbyte)((i & 0x7FL) | 0x80L)));
                i = (long)((ulong)i >> 7);
            }
            WriteByte((byte)(sbyte)i);
        }

Usage Example

 public override bool Store(DataOutput output)
 {
     lock (this)
     {
         output.WriteVLong(count);
         if (this.normalCompletion == null || normalCompletion.FST == null)
         {
             return false;
         }
         normalCompletion.FST.Save(output);
         return true;
     }
 }
All Usage Examples Of Lucene.Net.Store.DataOutput::WriteVLong