<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />

Org.BouncyCastle.Utilities.IO.Streams

public static class Streams
namespace Org.BouncyCastle.Utilities.IO { public static class Streams { public static int DefaultBufferSize { get; } public static void CopyTo(Stream source, Stream destination); public static void CopyTo(Stream source, Stream destination, int bufferSize); public static Task CopyToAsync(Stream source, Stream destination); public static Task CopyToAsync(Stream source, Stream destination, int bufferSize); public static Task CopyToAsync(Stream source, Stream destination, CancellationToken cancellationToken); public static Task CopyToAsync(Stream source, Stream destination, int bufferSize, CancellationToken cancellationToken); public static void Drain(Stream inStr); public static void PipeAll(Stream inStr, Stream outStr); public static void PipeAll(Stream inStr, Stream outStr, int bufferSize); public static long PipeAllLimited(Stream inStr, long limit, Stream outStr); public static long PipeAllLimited(Stream inStr, long limit, Stream outStr, int bufferSize); public static byte[] ReadAll(Stream inStr); public static byte[] ReadAll(MemoryStream inStr); public static byte[] ReadAllLimited(Stream inStr, int limit); public static int ReadFully(Stream inStr, byte[] buf); public static int ReadFully(Stream inStr, byte[] buf, int off, int len); public static void ValidateBufferArguments(byte[] buffer, int offset, int count); public static int WriteBufTo(MemoryStream buf, byte[] output, int offset); } }