/// <summary> /// Initializes a new instance of the <see cref="BfshaFileLoader"/> class loading data into the given /// <paramref name="bfshaFile"/> from the specified <paramref name="stream"/> which is optionally left open. /// </summary> /// <param name="bfshaFile">The <see cref="Bfsha.bfshaFile"/> instance to load data into.</param> /// <param name="stream">The <see cref="Stream"/> to read data from.</param> /// <param name="leaveOpen"><c>true</c> to leave the stream open after reading, otherwise <c>false</c>.</param> internal BfshaFileLoader(BnshFile bnshFile, Stream stream, bool leaveOpen = false) : base(stream, Encoding.ASCII, leaveOpen) { ByteOrder = ByteOrder.LittleEndian; BnshFile = bnshFile; _dataMap = new Dictionary <uint, IResData>(); }
/// <summary> /// Initializes a new instance of the <see cref="BfshaFileSaver"/> class saving data from the given /// <paramref name="BfshaFile"/> into the specified <paramref name="stream"/> which is optionally left open. /// </summary> /// <param name="BfshaFile">The <see cref="Bfsha.BfshaFile"/> instance to save data from.</param> /// <param name="stream">The <see cref="Stream"/> to save data into.</param> /// <param name="leaveOpen"><c>true</c> to leave the stream open after writing, otherwise <c>false</c>.</param> internal BfshaFileSaver(BnshFile bnshFile, Stream stream, bool leaveOpen) : base(stream, Encoding.ASCII, leaveOpen) { ByteOrder = ByteOrder.LittleEndian; BnshFile = bnshFile; }
/// <summary> /// Initializes a new instance of the <see cref="BfshaFileSaver"/> class for the file with the given /// <paramref name="fileName"/>. /// </summary> /// <param name="BfshaFile">The <see cref="Bfsha.BnshFile"/> instance to save.</param> /// <param name="fileName">The name of the file to save the data into.</param> internal BfshaFileSaver(BnshFile BnshFile, string fileName) : this(BnshFile, new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read), false) { }
/// <summary> /// Initializes a new instance of the <see cref="BfshaFileLoader"/> class from the file with the given /// <paramref name="fileName"/>. /// </summary> /// <param name="BfshaFile">The <see cref="Bfsha.BfshaFile"/> instance to load data into.</param> /// <param name="fileName">The name of the file to load the data from.</param> internal BfshaFileLoader(BnshFile BnshFile, string fileName) : this(BnshFile, new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) { }