Esempio n. 1
0
 public static uint CaclulateCRC32(byte[] buffer)
 {
     using (FixedArray bufferPtr = new FixedArray(buffer))
     {
         return(ZLib.crc32(0, bufferPtr, (uint)buffer.Length));
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        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);
        }