code: public int read() throws IOException {
          int ch = in.read();
          if (on && ch != -1) {
              digest.update((byte)ch);
          }
          return ch;
      }
docs: Reads a byte, and updates the message digest (if the digest
  function is on).  That is, this method reads a byte from the
  input stream, blocking until the byte is actually read. If the
  digest function is on (see {@link #on(boolean) on}), this method
  will then call {@code update} on the message digest associated
  with this stream, passing it the byte read.
  
  @return the byte read.
  
  @exception IOException if an I/O error occurs.
  
  @see MessageDigest#update(byte)