/// <summary> /// Returns the highest sector in use by the ISO9660 image. This method assumes that this sector will be in use by a <see cref="FileSector"/>. /// </summary> /// <returns>The highest sector used by the image.</returns> public UInt32 GetHighestSectorUsed() { var lastsectoritem = SectorMap.Last(); if (lastsectoritem.Value is FileSector file) { var lastsectorused = lastsectoritem.Key + (MathUtil.RoundUp(file.Record.DataLength, (UInt32)DefaultSectorSize) / DefaultSectorSize); return((UInt32)lastsectorused); } throw new Exception(); }