public int CopyTo(byte[] output, int offset, int length) {
int end;
if (length > this.bytesUsed) {
end = this.end;
length = this.bytesUsed;
}
else {
end = ((this.end - this.bytesUsed) + length) & 0x7fff;
}
int num2 = length;
int num3 = length - end;
if (num3 > 0) {
Array.Copy(this.window, 0x8000 - num3, output, offset, num3);
offset += num3;
length = end;
}
Array.Copy(this.window, end - length, output, offset, length);
this.bytesUsed -= num2;
return num2;
}