Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        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);
            }
        }