diff --git a/crypto/src/tls/TlsStream.cs b/crypto/src/tls/TlsStream.cs
index 5c07da2bf..d7d79a6fa 100644
--- a/crypto/src/tls/TlsStream.cs
+++ b/crypto/src/tls/TlsStream.cs
@@ -1,5 +1,9 @@
using System;
using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+
+using Org.BouncyCastle.Utilities.IO;
namespace Org.BouncyCastle.Tls
{
@@ -28,6 +32,18 @@ namespace Org.BouncyCastle.Tls
get { return true; }
}
+#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
+ public override void CopyTo(Stream destination, int bufferSize)
+ {
+ Streams.CopyTo(this, destination, bufferSize);
+ }
+#endif
+
+ public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
+ {
+ return Streams.CopyToAsync(this, destination, bufferSize, cancellationToken);
+ }
+
protected override void Dispose(bool disposing)
{
if (disposing)
@@ -63,6 +79,11 @@ namespace Org.BouncyCastle.Tls
{
return m_handler.ReadApplicationData(buffer);
}
+
+ public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
+ {
+ return Streams.ReadAsync(this, buffer, cancellationToken);
+ }
#endif
public override int ReadByte()
@@ -92,6 +113,11 @@ namespace Org.BouncyCastle.Tls
{
m_handler.WriteApplicationData(buffer);
}
+
+ public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
+ {
+ return Streams.WriteAsync(this, buffer, cancellationToken);
+ }
#endif
public override void WriteByte(byte value)
|