public void ReadFromStream(OsuReader o) { try { Version = o.ReadInt32(); FolderCount = o.ReadInt32(); AccountUnlocked = o.ReadBoolean(); UnlockDate = o.ReadDateTime(); PlayerName = o.ReadString(); int numberOfBeatmaps = o.ReadInt32(); Beatmaps = new List <Beatmap>(); for (int i = 0; i < numberOfBeatmaps; i++) { Beatmaps.Add(new Beatmap(o, Version)); } UserPermission = (UserPermission)o.ReadInt32(); } catch (Exception e) { if (e.GetType() == typeof(InvalidDataException)) { throw; } else { throw new InvalidDataException("Invalid data", e); } } }