public override void Read(BinaryReader reader) { base.Read(reader); if (this.Name != "mhba") { throw new ApplicationException("unexpected record type: " + this.Name); } byte [] body = reader.ReadBytes(this.HeaderOne - 12); unknownOne = BitConverter.ToInt32(body, 0); ItemCount = BitConverter.ToInt32(body, 4); unknownTwo = BitConverter.ToInt32(body, 8); // if (unknownOne != 1) { throw new System.Exception("Unexpected title count or something, figure it out"); } TitleRecord = new ImageDataObjectRecord(); TitleRecord.Read(reader); Items = new ArrayList(); for (int i = 0; i < ItemCount; i++) { AlbumItemRecord rec = new AlbumItemRecord(); rec.Read(reader); Items.Add(rec); } }
public override void Read (BinaryReader reader) { base.Read (reader); if (this.Name != "mhba") throw new ApplicationException ("unexpected record type: " + this.Name); byte [] body = reader.ReadBytes (this.HeaderOne - 12); unknownOne = BitConverter.ToInt32 (body, 0); ItemCount = BitConverter.ToInt32 (body, 4); unknownTwo = BitConverter.ToInt32 (body, 8); // if (unknownOne != 1) throw new System.Exception ("Unexpected title count or something, figure it out"); TitleRecord = new ImageDataObjectRecord (); TitleRecord.Read (reader); Items = new ArrayList (); for (int i = 0; i < ItemCount; i++) { AlbumItemRecord rec = new AlbumItemRecord (); rec.Read (reader); Items.Add (rec); } }