Example #1
0
		/// <summary>
		/// The constructor for the record.
		/// </summary>
		/// <param name="biff">The GenericBiff record that should contain the correct type and data for the BOF record.</param>
		/// <exception cref="InvalidRecordIdException">
		/// An InvalidRecordIdException is thrown if biff contains an invalid type or invalid data.
		/// </exception>
		public BofRecord(GenericBiff biff)
		{
			if(biff.Id == (ushort)RecordType.Bof)
			{
				BinaryReader reader = new BinaryReader(biff.GetDataStream());
				_version = reader.ReadUInt16();
				_type = (SubstreamType)reader.ReadUInt16();
				_buildId = reader.ReadUInt16();
				_buildYear = reader.ReadUInt16();
				_history = reader.ReadUInt32();
				_lowestBiff = reader.ReadUInt32();
			}
			else
				throw new InvalidRecordIdException(biff.Id, RecordType.Bof);
		}
Example #2
0
 /// <summary>
 /// The constructor for the record.
 /// </summary>
 /// <param name="biff">The GenericBiff record that should contain the correct type and data for the BOF record.</param>
 /// <exception cref="InvalidRecordIdException">
 /// An InvalidRecordIdException is thrown if biff contains an invalid type or invalid data.
 /// </exception>
 public BofRecord(GenericBiff biff)
 {
     if (biff.Id == (ushort)RecordType.Bof)
     {
         BinaryReader reader = new BinaryReader(biff.GetDataStream());
         _version    = reader.ReadUInt16();
         _type       = (SubstreamType)reader.ReadUInt16();
         _buildId    = reader.ReadUInt16();
         _buildYear  = reader.ReadUInt16();
         _history    = reader.ReadUInt32();
         _lowestBiff = reader.ReadUInt32();
     }
     else
     {
         throw new InvalidRecordIdException(biff.Id, RecordType.Bof);
     }
 }