/// <summary> /// Constructs and initializes a new instance of <see /// cref="File" /> for a specified file abstraction with an /// average read style. /// </summary> /// <param name="abstraction"> /// A <see cref="IFileAbstraction" /> object to use when /// reading from and writing to the file. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="abstraction" /> is <see langref="null" /// />. /// </exception> public File (File.IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { }
/// <summary> /// Overwrites the existing box in the file after updating /// the table for a size change. /// </summary> /// <param name="file"> /// A <see cref="File" /> object containing the file to which /// the current instance belongs and wo which modifications /// must be applied. /// </param> /// <param name="sizeDifference"> /// A <see cref="long" /> value containing the size /// change that occurred in the file. /// </param> /// <param name="after"> /// A <see cref="long" /> value containing the position in /// the file after which offsets will be invalidated. If an /// offset is before this point, it won't be updated. /// </param> /// <exception cref="ArgumentNullException"> /// <param name="file" /> is <see langref="null" />. /// </exception> public void Overwrite (File file, long sizeDifference, long after) { if (file == null) throw new ArgumentNullException ("file"); file.Insert (Render (sizeDifference, after), Header.Position, Size); }
/// <summary> /// Constructs and initializes a new instance of <see /// cref="File" /> for a specified file abstraction and /// specified read style. /// </summary> /// <param name="abstraction"> /// A <see cref="IFileAbstraction" /> object to use when /// reading from and writing to the file. /// </param> /// <param name="propertiesStyle"> /// A <see cref="ReadStyle" /> value specifying at what level /// of accuracy to read the media properties, or <see /// cref="ReadStyle.None" /> to ignore the properties. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="abstraction" /> is <see langref="null" /// />. /// </exception> public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Read (propertiesStyle); }