public void TestWriteBackTheSameExactFile() => File.OpenRead(FilePath).Using(stream => Helpers.AssertStream(stream, inStream => { var outStream = new MemoryStream(); SaveKh1.Read(inStream).Write(outStream); return(outStream); }));
public void OpenStream(Stream stream) { try { Save = SaveKh1.Read(stream); } catch (NotSupportedException ex) { throw new SaveNotSupportedException(ex.Message); } RefreshUi(); }
public void OpenStream(Stream stream) { switch (SaveKh1.GetGameVersion(stream)) { case Constants.MagicCodeFm: save = SaveKh1.Read <SaveKh1.SaveFinalMix>(stream); break; default: throw new SaveNotSupportedException("The version is not supported."); } RefreshUi(); }