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

◆ CopyTo()

static unsafe void System.Reflection.Internal.StreamExtensions.CopyTo ( this Stream source,
byte * destination,
int size )
inlinestaticpackage

Definition at line 10 of file StreamExtensions.cs.

11 {
12 byte[] array = new byte[Math.Min(81920, size)];
13 while (size > 0)
14 {
15 int num = Math.Min(size, array.Length);
16 int num2 = source.Read(array, 0, num);
17 if (num2 <= 0 || num2 > num)
18 {
20 }
21 Marshal.Copy(array, 0, (IntPtr)destination, num2);
22 destination += num2;
23 size -= num2;
24 }
25 }
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
Definition Marshal.cs:800
static string UnexpectedStreamEnd
Definition SR.cs:98
Definition SR.cs:7

References System.array, System.Runtime.InteropServices.Marshal.Copy(), System.destination, System.Math.Min(), System.source, and System.SR.UnexpectedStreamEnd.