This library provides a collection of fake stream for testing. A constant stream is an lazy stream (not backed by a base stream) and provide a basic reading operations of a stream of bytes (the same byte or stride of bytes). The streams imitate a NetworkStream by providing only the "Read" operation and not "Seek", "Length" or "Write".
$ dotnet add package ConstantStreamA constant stream for testing purposes
// creates a 1 Mb stream of zeroes.
var zeroesStream = new ConstantStream(1024*1000, (byte)0);
// creates a 1 Gb stream full of 's'.
var sStream = new ConstantStream(1024*1000*1000, (byte)'s');
The Stream doesnt have a base stream. Its a fake generator.