public void TestReadLineBufferEndsWithEOLKeepEOL()
        {
            var data = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, Octets.CR};
              var stream = new LooseLineOrientedStream(new MemoryStream(data), 8);

              Assert.AreEqual(data, stream.ReadLine(true));
        }
        public void TestReadLineBufferEndsWithEOLDiscardEOL()
        {
            var data = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, Octets.CR};
              var stream = new LooseLineOrientedStream(new MemoryStream(data), 8);

              Assert.AreEqual(ArrayExtensions.Slice(data, 0, 7), stream.ReadLine(false));
        }
        public void TestReadLineKeepEOL()
        {
            var data = new byte[] {0x00, Octets.CR, 0x02, Octets.LF, 0x04, Octets.LF, Octets.CR, 0x07, Octets.CR, Octets.LF, 0x00};
              var stream = new LooseLineOrientedStream(new MemoryStream(data), 8);

              Assert.AreEqual(ArrayExtensions.Slice(data, 0, 2), stream.ReadLine());
              Assert.AreEqual(ArrayExtensions.Slice(data, 2, 2), stream.ReadLine());
              Assert.AreEqual(ArrayExtensions.Slice(data, 4, 2), stream.ReadLine());
              Assert.AreEqual(ArrayExtensions.Slice(data, 6, 1), stream.ReadLine());
              Assert.AreEqual(ArrayExtensions.Slice(data, 7, 3), stream.ReadLine());
              Assert.AreEqual(ArrayExtensions.Slice(data, 10, 1), stream.ReadLine());
              Assert.IsNull(stream.ReadLine());
        }