public Int32 GetCrc32AndCopy(System.IO.Stream input, System.IO.Stream output)
{
if (input == null)
throw new ZlibException ("The input stream must not be null.");
unchecked {
//UInt32 crc32Result;
//crc32Result = 0xFFFFFFFF;
byte[] buffer = new byte[BUFFER_SIZE];
int readSize = BUFFER_SIZE;
_TotalBytesRead = 0;
int count = input.Read (buffer, 0, readSize);
if (output != null)
output.Write (buffer, 0, count);
_TotalBytesRead += count;
while (count > 0) {
//for (int i = 0; i < count; i++)
//{
// _RunningCrc32Result = ((_RunningCrc32Result) >> 8) ^ crc32Table[(buffer[i]) ^ ((_RunningCrc32Result) & 0x000000FF)];
//}
SlurpBlock (buffer, 0, count);
count = input.Read (buffer, 0, readSize);
if (output != null)
output.Write (buffer, 0, count);
_TotalBytesRead += count;
}
return (Int32)(~_RunningCrc32Result);
}
}