summary refs log tree commit diff
path: root/crypto/src/tls/ByteQueue.cs
diff options
context:
space:
mode:
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