示例#1
0
 public void Read(IInputStream input)
 {
     this.hashA       = input.ReadLong();
     this.hashB       = input.ReadLong();
     this.index       = input.ReadInt();
     this.keySize     = input.ReadInt();
     this.key         = UTF8Encoding.UTF8.GetString(input.ReadBytes(keySize), 0, keySize);
     this.fileDate    = input.ReadInt();
     this.fileMD5Size = input.ReadInt();
     this.fileMD5     = UTF8Encoding.UTF8.GetString(input.ReadBytes(fileMD5Size), 0, fileMD5Size);
     this.fileOffset  = input.ReadInt();
     this.fileSize    = input.ReadInt();
 }
示例#2
0
            public long UnpackLong()
            {
                byte markerByte = _in.ReadByte();

                if ((sbyte)markerByte >= MINUS_2_TO_THE_4)
                {
                    return((sbyte)markerByte);
                }
                switch (markerByte)
                {
                case INT_8:
                    return(_in.ReadSByte());

                case INT_16:
                    return(_in.ReadShort());

                case INT_32:
                    return(_in.ReadInt());

                case INT_64:
                    return(_in.ReadLong());

                default:
                    throw new ArgumentOutOfRangeException(nameof(markerByte), markerByte,
                                                          $"Expected an integer, but got: 0x{markerByte.ToString("X2")}");
                }
            }