private void ReadBrotli(EndianReader reader) { using (SmartStream stream = SmartStream.CreateMemory()) { using (BrotliInputStream brotliStream = new BrotliInputStream(reader.BaseStream)) { brotliStream.CopyStream(stream); stream.Position = 0; } string name = Path.GetFileName(m_filePath); ArchiveFileEntry entry = new ArchiveFileEntry(stream, m_filePath, name, 0, stream.Length); Metadata = new ArchiveMetadata(entry); } }
private void ReadGZip(EndianReader reader) { using (SmartStream stream = SmartStream.CreateMemory()) { using (GZipStream gzipStream = new GZipStream(reader.BaseStream, CompressionMode.Decompress)) { gzipStream.CopyTo(stream); stream.Position = 0; } string name = Path.GetFileName(m_filePath); ArchiveFileEntry entry = new ArchiveFileEntry(stream, m_filePath, name, 0, stream.Length); Metadata = new ArchiveMetadata(entry); } }