summary refs log tree commit diff
path: root/crypto/src/tls/ByteQueue.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-10-08 20:06:43 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-10-08 20:06:43 +0700
commitbf3678ca81204f8ea9c253cc35a96c6c7ce12b42 (patch)
tree9e134a828d6d21b00e38b425692a7c8df3106927 /crypto/src/tls/ByteQueue.cs
parentRefactor TestSampler (diff)
downloadBouncyCastle.NET-ed25519-bf3678ca81204f8ea9c253cc35a96c6c7ce12b42.tar.xz
New Spans methods
Diffstat (limited to 'crypto/src/tls/ByteQueue.cs')
-rw-r--r--crypto/src/tls/ByteQueue.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/src/tls/ByteQueue.cs b/crypto/src/tls/ByteQueue.cs
index b85106528..74a7104ba 100644
--- a/crypto/src/tls/ByteQueue.cs
+++ b/crypto/src/tls/ByteQueue.cs
@@ -1,6 +1,8 @@
 using System;
 using System.IO;
 
+using Org.BouncyCastle.Utilities;
+
 namespace Org.BouncyCastle.Tls
 {
     /// <summary>A queue for bytes. This file could be more optimized.</summary>
@@ -171,7 +173,7 @@ namespace Org.BouncyCastle.Tls
             if ((m_available - skip) < buffer.Length)
                 throw new InvalidOperationException("Not enough data to read");
 
-            m_databuf.AsSpan(m_skipped + skip, buffer.Length).CopyTo(buffer);
+            buffer.CopyFrom(m_databuf.AsSpan(m_skipped + skip));
         }
 #endif