Inheritance: System.IO.BinaryReader
        public void Can_read_write_nested_named_stream()
        {
            ////Arrange
            using (var stream = new MemoryStream())
            {
                using (var archiveWriter = new ArchiveWriter(stream, true))
                    archiveWriter
                        .AddStream("test.txt", new MemoryStream(Encoding.UTF8.GetBytes("hello world")))
                        .AddStream("this/is/nested/test.txt", new MemoryStream(Encoding.UTF8.GetBytes("hello world")));

                stream.Position = 0;

                using (var archiveReader = new ArchiveReader(stream))
                using (var destinationStream = new MemoryStream())
                {
                    // move to second file
                    archiveReader.ReadFileName();
                    archiveReader.ExtractToStream(Stream.Null);

                    ////Act
                    var file = archiveReader.ReadFileName();
                    archiveReader.ExtractToStream(destinationStream);

                    ////Assert
                    Assert.That(file, Is.EqualTo("this/is/nested/test.txt"));
                    Assert.That(Encoding.UTF8.GetString(destinationStream.ToArray()), Is.EqualTo("hello world"));
                }
            }
        }
        public void Can_read_write_binary_to_stream()
        {
            ////Arrange
            using (var stream = new MemoryStream())
            {
                using (var archiveWriter = new ArchiveWriter(stream, true))
                    archiveWriter.AddStream("test.bin", new MemoryStream(new byte[] { 1, 2, 3 }));

                stream.Position = 0;

                using (var archiveReader = new ArchiveReader(stream))
                using (var destinationStream = new MemoryStream())
                {
                    ////Act
                    var file = archiveReader.ReadFileName();
                    archiveReader.ExtractToStream(destinationStream);

                    ////Assert
                    Assert.That(file, Is.EqualTo("test.bin"));
                    Assert.AreEqual(destinationStream.ToArray(), new byte[] { 1, 2, 3 });
                }
            }
        }
        private void ExtractEmbeddedLz4Stream(string name, DirectoryInfo destination)
        {
            var started = Stopwatch.StartNew();

            using (var stream = GetType().Assembly.GetManifestResourceStream(typeof(RessourceTarget), name))
            using (var decompresStream = new LZ4Stream(stream, CompressionMode.Decompress))
            using (var archiveReader = new ArchiveReader(decompresStream))
                archiveReader.ExtractToDirectory(destination);

            Info("Extracted {0} in {1} seconds", name, started.Elapsed.TotalSeconds);
        }