/* ---------------------------------------------------------------------------------------------------------------------------------- */ PackFile(MemoryStream packStream) { m_packStream = packStream; m_packStream.Seek(0, SeekOrigin.Begin); Contents = PackContents.CreateFromPackFile(m_packStream); }
/* ---------------------------------------------------------------------------------------------------------------------------------- */ public static PackContents CreateFromWdtFile(WdtFile wdtFile) { Chapter contentsChapter = wdtFile.ChapterList[0]; byte[] contentDecompressed = new byte [wdtFile.PageSize]; var memStream = new MemoryStream(contentDecompressed); WdtDecompressor.DecompressChapter(wdtFile, contentsChapter, memStream); PackContents packContents; using (var decompressedStream = new MemoryStream(contentDecompressed)) { packContents = new PackContents(decompressedStream); } return(packContents); }