static void ReadProperty(ref FastStream fs) { var slice = fs.Slice(2); var type = slice[0]; //var anyType = slice[1]; switch (type) { case 0: fs.Push(null !); break; case 1: fs.PushOp(Op.ReadBool); break; case 2: fs.PushOp(Op.ReadDouble); break; case 3: fs.PushOp(Op.ReadString); break; case 4: fs.PushOp(Op.ReadList); break; case 5: fs.PushOp(Op.ReadDictionary); break; } }
static void ReadDictionary(ref FastStream fs) { var length = (int)BitConverter.ToUInt32(fs.Slice(sizeof(uint))); fs.PushOp(Op.PushInt, (Op)length, Op.FinishReadDictionary); for (int i = 0; i < length; i++) { fs.PushOp(Op.ReadProperty); fs.PushOp(Op.ReadString); } }