blob: 441a3773a54da8cca37e58b4ab2396c102c11bf2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
using System;
using Org.BouncyCastle.Utilities.IO;
namespace Org.BouncyCastle.Tls
{
/// <summary>OutputStream based on a ByteQueue implementation.</summary>
public sealed class ByteQueueOutputStream
: BaseOutputStream
{
private readonly ByteQueue m_buffer;
public ByteQueueOutputStream()
{
this.m_buffer = new ByteQueue();
}
public ByteQueue Buffer
{
get { return m_buffer; }
}
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[]{ value }, 0, 1);
}
}
}
|