public void Decode_NotGivingPartialDataFromStream()
        {
            var expected = Utilities.GetRandom <byte[]>(false);

            using (var chunked = new ChunkedStream(this.Stream, 3))
            {
                var encoder = this.CreateEncoder(chunked);
                encoder.Encode(expected);
                encoder.Flush();

                chunked.Seek(0, SeekOrigin.Begin);

                var decoder = this.CreateDecoder(chunked);
                var actual  = decoder.DecodeByteArray();

                Assert.IsTrue(expected.SequenceEqual(actual));
            }
        }
        public void Decode_NotGivingPartialDataFromStream()
        {
            var expected = Utilities.GetRandom<byte[]>(false);

            using (var chunked = new ChunkedStream(this.Stream, 3))
            {
                var encoder = this.CreateEncoder(chunked);
                encoder.Encode(expected);
                encoder.Flush();

                chunked.Seek(0, SeekOrigin.Begin);

                var decoder = this.CreateDecoder(chunked);
                var actual = decoder.DecodeByteArray();

                Assert.IsTrue(expected.SequenceEqual(actual));
            }
        }