예제 #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);
            }
        }
예제 #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);
            }
        }