public override async Task SaveFile() { byte[][] data = await Task.WhenAll(this.storage.Select((s, i) => s.Save())); var memGarc = await GarcUtil.PackGarc(data, this.Def.Version, (int)this.Def.ContentPadToNearest); this.Def = memGarc.Def; this.Data = memGarc.Data; }
public virtual async Task SetFiles(byte[][] files) { if (files == null || files.Length != this.FileCount) { throw new ArgumentException(); } var memGarc = await GarcUtil.PackGarc(files, this.Def.Version, (int)this.Def.ContentPadToNearest); this.Def = memGarc.Def; this.Data = memGarc.Data; }
public virtual async Task SaveFile() { byte[][] data = new byte[this.FileCount][]; for (int i = 0; i < data.Length; i++) { data[i] = await this.GetFile(i); } var memGarc = await GarcUtil.PackGarc(data, this.Def.Version, (int)this.Def.ContentPadToNearest); this.Def = memGarc.Def; this.Data = memGarc.Data; }