void WriteFileSector(BinaryWriter writer, FileSector filesector) { Assert.IsNotNull(writer, nameof(writer)); Assert.IsNotNull(filesector, nameof(filesector)); writer.Write(filesector.GetData()); }
/// <summary> /// Moves a file in the image to a different sector. Updates the sector map and the <see cref="DirectoryRecord"/> of the file. This method does not perform any validation on whether the file can be moved to the given sector. /// </summary> /// <param name="filesector">The <see cref="FileSector"/> to be moved.</param> /// <param name="newsector">The sector to move the <see cref="FileSector"/> to.</param> public void ChangeFileSector(FileSector filesector, UInt32 newsector) { Assert.IsNotNull(filesector, nameof(filesector)); SectorMap.Remove(filesector.Record.SectorNumber); SectorMap[newsector] = filesector; filesector.Record.SectorNumber = newsector; }