IEnumerable <ByteBuffer> CopySequencer()
        {
            active = true;
            var reader = source.Read(OnSourceData, OnSourceError, OnSourceClose);

            target.PauseWriting();
            yield return(new ByteBuffer(new byte[0], 0, 0));

            while (active)
            {
                var buffer = currentBuffer;
                target.PauseWriting();
                source.ResumeReading();
                yield return(buffer);
            }
            reader.Dispose();
            if (ownsSource)
            {
                source.Close();
            }
            source        = null;
            target        = null;
            currentBuffer = null;
        }
 public void Close()
 {
     _byteStream.Close();
 }