class MD5 {

  void Update(final MD5State stat, final byte[] buffer, final int offset,
              final int length) {
    int index;
    int partlen;
    int i;
    final int start;
    finals = null;
    int newlength = length;
    /* Length can be told to be shorter, but not inter */
    if (newlength + offset > buffer.length) {
      newlength = buffer.length - offset;
    }

    /* compute number of bytes mod 64 */

    index = (int) (stat.count & 0x3f);
    stat.count += newlength;

    partlen = 64 - index;

    if (newlength >= partlen) {
      // update state (using only Java) to reflect input

      final int[] decodeBuf = new int[16];
      if (partlen == 64) {
        partlen = 0;
      } else {
        for (i = 0; i < partlen; i++) {
          stat.buffer[i + index] = buffer[i + offset];
        }
        transform(stat, stat.buffer, 0, decodeBuf);
      }
      for (i = partlen; i + 63 < newlength; i += 64) {
        transform(stat, buffer, i + offset, decodeBuf);
      }
      index = 0;
    } else {
      i = 0;
    }

    /* buffer remaining input */
    if (i < newlength) {
      start = i;
      for (; i < newlength; i++) {
        stat.buffer[index + i - start] = buffer[i + offset];
      }
    }
  }

    MD5();
    MD5(final Object ob);

}