Code example for CRC32

Methods: getValue, reset, update

0
    this.bytePos = writeByte((this.encodeAlpha) ? 6 : 2, this.bytePos);
    // direct model 
    this.bytePos = writeByte(0, this.bytePos); // compression method
    this.bytePos = writeByte(0, this.bytePos); // filter method
    this.bytePos = writeByte(0, this.bytePos); // no interlace
    this.crc.reset();
    this.crc.update(this.pngBytes, startPos, this.bytePos - startPos);
    this.crcValue = this.crc.getValue();
    this.bytePos = writeInt4((int) this.crcValue, this.bytePos);
  } 
 
  /** 
   * Perform "sub" filtering on the given row. Uses temporary array leftBytes to store the original values of the 
   * previous pixels.  The array is 16 bytes long, which will easily hold two-byte samples plus two-byte alpha. 
   * 
   * @param pixels   The array holding the scan lines being built 
   * @param startPos Starting position within pixels of bytes to be filtered. 
   * @param width    Width of a scanline in pixels. 
   */ 
  protected void filterSub(final byte[] pixels, final int startPos, final int width)
  {