public static object ReadVariable(this ZPackage zp, Type t) { if (t == typeof(int)) { return(zp.ReadInt()); } if (t == typeof(uint)) { return(zp.ReadUInt()); } if (t == typeof(bool)) { return(zp.ReadBool()); } if (t == typeof(char)) { return(zp.ReadChar()); } if (t == typeof(sbyte)) { return(zp.ReadSByte()); } if (t == typeof(long)) { return(zp.ReadLong()); } if (t == typeof(ulong)) { return(zp.ReadULong()); } if (t == typeof(float)) { return(zp.ReadSingle()); } if (t == typeof(double)) { return(zp.ReadDouble()); } if (t == typeof(string)) { return(zp.ReadString()); } return(null); }