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

◆ GetCopyBufferSize()

int System.IO.Stream.GetCopyBufferSize ( )
inlineprivateinherited

Definition at line 616 of file Stream.cs.

617 {
618 int num = 81920;
619 if (CanSeek)
620 {
621 long length = Length;
622 long position = Position;
623 if (length <= position)
624 {
625 num = 1;
626 }
627 else
628 {
629 long num2 = length - position;
630 if (num2 > 0)
631 {
632 num = (int)Math.Min(num, num2);
633 }
634 }
635 }
636 return num;
637 }

References System.IO.Stream.CanSeek, System.length, System.IO.Stream.Length, System.Math.Min(), and System.IO.Stream.Position.

Referenced by System.IO.Stream.CopyTo(), System.IO.Stream.CopyToAsync(), and System.IO.Stream.CopyToAsync().