<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0-beta.98" />

ByteQueueOutputStream

public sealed class ByteQueueOutputStream : BaseOutputStream
OutputStream based on a ByteQueue implementation.
using Org.BouncyCastle.Utilities.IO; namespace Org.BouncyCastle.Tls { public sealed class ByteQueueOutputStream : BaseOutputStream { private readonly ByteQueue m_buffer; public ByteQueue Buffer => m_buffer; public ByteQueueOutputStream() { m_buffer = new ByteQueue(); } public override void Write(byte[] buffer, int offset, int count) { Streams.ValidateBufferArguments(buffer, offset, count); m_buffer.AddData(buffer, offset, count); } public override void WriteByte(byte value) { m_buffer.AddData(new byte[1] { value }, 0, 1); } } }