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

◆ WriteLengthDistance()

void System.IO.Compression.OutputWindow.WriteLengthDistance ( int length,
int distance )
inline

Definition at line 25 of file OutputWindow.cs.

26 {
28 int num = (_end - distance) & 0x3FFFF;
29 int num2 = 262144 - length;
30 if (num <= num2 && _end < num2)
31 {
32 if (length <= distance)
33 {
34 Array.Copy(_window, num, _window, _end, length);
35 _end += length;
36 }
37 else
38 {
39 while (length-- > 0)
40 {
41 _window[_end++] = _window[num++];
42 }
43 }
44 }
45 else
46 {
47 while (length-- > 0)
48 {
49 _window[_end++] = _window[num++];
50 _end &= 262143;
51 num &= 0x3FFFF;
52 }
53 }
54 }

References System.IO.Compression.OutputWindow._bytesUsed, System.IO.Compression.OutputWindow._end, System.IO.Compression.OutputWindow._window, System.Array.Copy(), and System.length.

Referenced by System.IO.Compression.InflaterManaged.DecodeBlock().