summary refs log tree commit diff
path: root/crypto/src/tls/ByteQueueInputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/tls/ByteQueueInputStream.cs')
-rw-r--r--crypto/src/tls/ByteQueueInputStream.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/crypto/src/tls/ByteQueueInputStream.cs b/crypto/src/tls/ByteQueueInputStream.cs

index b59b5d1e7..0b15071ad 100644 --- a/crypto/src/tls/ByteQueueInputStream.cs +++ b/crypto/src/tls/ByteQueueInputStream.cs
@@ -31,6 +31,15 @@ namespace Org.BouncyCastle.Tls return bytesToRead; } + public override int Read(byte[] buffer, int offset, int count) + { + Streams.ValidateBufferArguments(buffer, offset, count); + + int bytesToRead = System.Math.Min(m_buffer.Available, count); + m_buffer.RemoveData(buffer, offset, bytesToRead, 0); + return bytesToRead; + } + public override int ReadByte() { if (m_buffer.Available == 0) @@ -39,13 +48,6 @@ namespace Org.BouncyCastle.Tls return m_buffer.RemoveData(1, 0)[0]; } - public override int Read(byte[] buf, int off, int len) - { - int bytesToRead = System.Math.Min(m_buffer.Available, len); - m_buffer.RemoveData(buf, off, bytesToRead, 0); - return bytesToRead; - } - public long Skip(long n) { int bytesToRemove = System.Math.Min((int)n, m_buffer.Available);