ConstantStream 1.0.17

dotnet add package ConstantStream --version 1.0.17
NuGet\Install-Package ConstantStream -Version 1.0.17
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConstantStream" Version="1.0.17" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConstantStream --version 1.0.17
#r "nuget: ConstantStream, 1.0.17"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ConstantStream as a Cake Addin
#addin nuget:?package=ConstantStream&version=1.0.17

// Install ConstantStream as a Cake Tool
#tool nuget:?package=ConstantStream&version=1.0.17

ConstantStream

NuGet version (ConstanStream) Downloads (ConstanStream) Issues (ConstanStream)

A collection of fake streams for testing purposes.

Types

The library have three fake stream types:

  • ConstantByteStream: A fake stream that generate a finite set of the same bytes.
  • ConstantStrideStream: A fake stream that generate a byte stride in a loop.
  • TimedStream: A fake constant byte stream that waits in determined positions.

Utility streams:

  • SubStream: a substream is a small window to the base stream.
  • CountedStream: record all the bytes readed.

For example:

// The constant byte stream
var cbs = ConstantByteStream(5, (byte) 'A'); 
// Should return  "AAAAA"
string text = (new StreamReader(cbs)).ReadToEnd() ;

// The constant stride stream
// Should read as "ABCABCABCA"
ConstantStrideStream(10, Encoding.UTF8.GetBytes("ABC")); 

// The TimedStream: just like a constant byte stream
var timedStream = new TimedStream(1024, (byte)'c'); 

// add a wait in position 0 of 200 ms
timedStream.Delays.Add(0, TimeSpan.FromMilliseconds(200)); 
// add a wait in position 15 of 250 ms
timedStream.Delays.Add(15, TimeSpan.FromMilliseconds(250)); 
// add a wait in position 1000 of 1 min
timedStream.Delays.Add(1000, TimeSpan.FromMinutes(1)); 
// the timedStream should take about 1 minute + 450 ms + reading overhead(ms) to read in total

Usage

using ConstantStream;

// Creates a 1 Mb stream of zeroes.
var zeroesStream = new ConstantByteStream(1024*1024, (byte)0);

// Creates a 1 Gb stream full of 's'.
var sStream = new ConstantByteStream(1024*1024*1024, (byte)'s');

// Handy factory methods (From*) for ConstantByteStream
// 1 Mb of zeroes
var zeroesStreamEasy = ConstantByteStream.FromZeroes(1024*1024);
// 1 Kb of ones 
var onesStreamEasy = ConstantByteStream.FromOnes(1024); 
// 42 bytes of 'a'
var onesStreamEasy = ConstantByteStream.FromFromA(42); 


// Handy factory methods (From*) for ConstantStrideStream
// 01234567890123456... numbers from 0 to 9 in a loop
var zeroesStreamEasy = ConstantStrideStream.FromNumbers(1024*1024); 
// abcdefghijkl.... alphabet in a loop
var zeroesStreamEasy = ConstantStrideStream.FromAlphabet(1024); 

Info

The Stream doesnt have a base stream. Its a fake generator and provide a simple Stream that generates large amounts of data. It can be used with stream readers like TextReader, copyTo(file), HttpBody, crypto readers, and compression readers.

Well Know Hashes

ConstantStream Size MD5 Hex MD5 Base64 SHA1 Hex SHA1 Base64
FromAlphabet 1 KB 930053E6D45C93FF2666C98BCD9610A1 kwBT5tRck/8mZsmLzZYQoQ== C167BE12C4F34DA6C4854C46A85627116B5E95FA wWe+EsTzTabEhUxGqFYnEWtelfo=
FromAlphabet 1 MB B63BA06DE0E8A9626D5BCF27E93BF32D tjugbeDoqWJtW88n6TvzLQ== DD89D1965604BD939EC68A6CA4552788F0EB1F88 3YnRllYEvZOexopspFUniPDrH4g=
FromAlphabet 10 MB D3344B5243DB57263EF171B989C41BE4 0zRLUkPbVyY+8XG5icQb5A== 2EB34A9141CE511DB12FA1BD24EB3F2E774D126C LrNKkUHOUR2xL6G9JOs/LndNEmw=
FromAlphabet 100 MB E19E759A14BF22353BAB93550B87472A 4Z51mhS/IjU7q5NVC4dHKg== B3BED9CEDB044AC81E6774D5EEBA5FBE6BCDF954 s77ZztsESsgeZ3TV7rpfvmvN+VQ=
FromAlphabet 500 MB C4A4DF0923DEE72ED2A3518F65EDA1F5 xKTfCSPe5y7So1GPZe2h9Q== 70048729EBB60D5EAA2A8CFC523AF1367282F6DD cASHKeu2DV6qKoz8UjrxNnKC9t0=
FromAlphabet 1 GB B472DC36AB28968EFBB4EC626BC98702 tHLcNqsolo77tOxia8mHAg== 0AC6BC4031B4E87FE60E1AAD28BA40C429F4F010 Csa8QDG06H/mDhqtKLpAxCn08BA=
FromAlphabet 2 GB F584057C53E521E9D0807427708E1114 9YQFfFPlIenQgHQncI4RFA== 22F7B64A171ADC8F800786ADA774620248F283A1 Ive2Shca3I+AB4atp3RiAkjyg6E=
FromAlphabet 5 GB 4429D83BEE447898A089835D7C46C83E RCnYO+5EeJigiYNdfEbIPg== 27348DE6DA54C4A81C65DAC3507461FBD93FB035 JzSN5tpUxKgcZdrDUHRh+9k/sDU=
FromAlphabet 10 GB A4ACBE93D79B63D60B7EC1B15C8157AA pKy+k9ebY9YLfsGxXIFXqg== 53FB7867996E742BF82DC525BF3CB09D7AAB67A0 U/t4Z5ludCv4LcUlvzywnXqrZ6A=
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.17 255 2/13/2023
1.0.16 214 2/13/2023
1.0.15 220 2/13/2023
1.0.14 224 2/13/2023
1.0.13 209 2/13/2023
1.0.12 210 2/13/2023
1.0.11 217 2/13/2023
1.0.10 207 2/13/2023
1.0.9 251 1/31/2023
1.0.8 241 1/31/2023
1.0.7 240 1/31/2023
1.0.6 245 1/31/2023
1.0.5 248 1/31/2023
1.0.4 293 1/31/2023
1.0.3 294 1/30/2023
1.0.2 294 1/30/2023
1.0.1 274 1/30/2023
1.0.0 267 1/30/2023