summary refs log tree commit diff
path: root/crypto/src/tls/TlsStream.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-11-01 21:23:33 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-11-01 21:23:33 +0700
commit944ced70e1e2f889eafe6b169a9c69396ae8cbee (patch)
tree788f0a9a7b6c18885ea9443deec14b6370076a4e /crypto/src/tls/TlsStream.cs
parentMore Span-based Stream methods (diff)
downloadBouncyCastle.NET-ed25519-944ced70e1e2f889eafe6b169a9c69396ae8cbee.tar.xz
Span-based TlsStream methods
Diffstat (limited to 'crypto/src/tls/TlsStream.cs')
-rw-r--r--crypto/src/tls/TlsStream.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/src/tls/TlsStream.cs b/crypto/src/tls/TlsStream.cs
index 01b990799..5c07da2bf 100644
--- a/crypto/src/tls/TlsStream.cs
+++ b/crypto/src/tls/TlsStream.cs
@@ -58,6 +58,13 @@ namespace Org.BouncyCastle.Tls
             return m_handler.ReadApplicationData(buffer, offset, count);
         }
 
+#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
+        public override int Read(Span<byte> buffer)
+        {
+            return m_handler.ReadApplicationData(buffer);
+        }
+#endif
+
         public override int ReadByte()
         {
             byte[] buf = new byte[1];
@@ -80,6 +87,13 @@ namespace Org.BouncyCastle.Tls
             m_handler.WriteApplicationData(buffer, offset, count);
         }
 
+#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
+        public override void Write(ReadOnlySpan<byte> buffer)
+        {
+            m_handler.WriteApplicationData(buffer);
+        }
+#endif
+
         public override void WriteByte(byte value)
         {
             m_handler.WriteApplicationData(new byte[]{ value }, 0, 1);