BTDB.StreamLayer.AbstractBufferedReader.ReadVUInt64 C# (CSharp) Method

ReadVUInt64() public method

public ReadVUInt64 ( ) : ulong
return ulong
        public ulong ReadVUInt64()
        {
            NeedOneByteInBuffer();
            var l = PackUnpack.LengthVUInt(Buf, Pos);
            ulong res;
            if (Pos + l <= End)
            {
                res = PackUnpack.UnpackVUInt(Buf, ref Pos);
            }
            else
            {
                res = (ulong)(Buf[Pos] & (0xff >> l));
                do
                {
                    Pos++;
                    res <<= 8;
                    NeedOneByteInBuffer();
                    res += Buf[Pos];
                    l--;
                } while (l > 1);
                Pos++;
            }
            return res;
        }

Usage Example

Esempio n. 1
0
 public FileKeyIndex(AbstractBufferedReader reader, Guid? guid, bool withCommitUlong)
 {
     _guid = guid;
     _generation = reader.ReadVInt64();
     _trLogFileId = reader.ReadVUInt32();
     _trLogOffset = reader.ReadVUInt32();
     _keyValueCount = (long)reader.ReadVUInt64();
     _commitUlong = withCommitUlong ? reader.ReadVUInt64() : 0;
 }
All Usage Examples Of BTDB.StreamLayer.AbstractBufferedReader::ReadVUInt64