BTDB.StreamLayer.AbstractBufferedReader.ReadVInt32 C# (CSharp) 메소드

ReadVInt32() 공개 메소드

public ReadVInt32 ( ) : int
리턴 int
        public int ReadVInt32()
        {
            var res = ReadVInt64();
            if (res > int.MaxValue || res < int.MinValue) throw new InvalidDataException(
                $"Reading VInt32 overflowed with {res}");
            return (int)res;
        }

Usage Example

예제 #1
0
 ITypeDescriptor NestedDescriptorReader(AbstractBufferedReader reader)
 {
     var typeId = reader.ReadVInt32();
     if (typeId < 0 && -typeId - 1 < _id2InfoNew.Count)
     {
         var infoForType = _id2InfoNew[-typeId - 1];
         if (infoForType != null)
             return infoForType.Descriptor;
     }
     else if (typeId > 0)
     {
         if (typeId >= _id2Info.Count)
             throw new BTDBException("Metadata corrupted");
         var infoForType = _id2Info[typeId];
         if (infoForType == null)
             throw new BTDBException("Metadata corrupted");
         return infoForType.Descriptor;
     }
     return new PlaceHolderDescriptor(typeId);
 }
All Usage Examples Of BTDB.StreamLayer.AbstractBufferedReader::ReadVInt32