Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyTo() [2/2]

unsafe override void System.Security.Cryptography.CryptoStream.CopyTo ( Stream destination,
int bufferSize )
inlinevirtual

Reimplemented from System.IO.Stream.

Definition at line 557 of file CryptoStream.cs.

558 {
560 byte[] array = ArrayPool<byte>.Shared.Rent(bufferSize);
561 fixed (byte* ptr = &array[0])
562 {
563 try
564 {
565 int num;
566 do
567 {
568 num = Read(array, 0, bufferSize);
569 destination.Write(array, 0, num);
570 }
571 while (num > 0);
572 }
573 finally
574 {
575 CryptographicOperations.ZeroMemory(array.AsSpan(0, bufferSize));
576 }
577 }
579 array = null;
580 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
void CheckCopyToArguments(Stream destination, int bufferSize)

References System.array, System.Security.Cryptography.CryptoStream.CheckCopyToArguments(), System.destination, System.Security.Cryptography.Read, System.Buffers.ArrayPool< T >.Shared, and System.Security.Cryptography.CryptographicOperations.ZeroMemory().