public static uint CaclulateCRC32(byte[] buffer) { using (FixedArray bufferPtr = new FixedArray(buffer)) { return(ZLib.crc32(0, bufferPtr, (uint)buffer.Length)); } }
public override void Write(byte[] buffer, int offset, int count) { pStream.Write(buffer, offset, count); using (FixedArray bufferPtr = new FixedArray(buffer)) { pCrcValue = ZLib.crc32(pCrcValue, bufferPtr[offset], (uint)count); } }
public override int Read(byte[] buffer, int offset, int count) { int readLen = pStream.Read(buffer, offset, count); using (FixedArray bufferPtr = new FixedArray(buffer)) { pCrcValue = ZLib.crc32(pCrcValue, bufferPtr[offset], (uint)readLen); } return(readLen); }