Exemplo n.º 1
0
        private Stream CreateCachedDecoderStream(ArchiveMetadata metadata, int section)
        {
            // TODO: decode stream once then reuse the cached data

            // HACK: this implementation is just a dirty hack to test something
            var buffer = new MemoryStream();

            using (var reader = new DecodedSectionReader(mStream, metadata, section, mPassword))
                using (var stream = reader.OpenStream())
                    stream.CopyTo(buffer);
            buffer.Position = 0;
            return(buffer);
        }
        private Stream CreateCachedDecoderStream(ArchiveMetadata metadata, int section)
        {
            // TODO: decode stream once then reuse the cached data

            // HACK: this implementation is just a dirty hack to test something
            var buffer = new MemoryStream();
            using (var reader = new DecodedSectionReader(mStream, metadata, section, mPassword))
            using (var stream = reader.OpenStream())
                stream.CopyTo(buffer);
            buffer.Position = 0;
            return buffer;
        }