code: public int read(byte[] b, int off, int len) throws IOException {
          int result = in.read(b, off, len);
          if (on && result != -1) {
              digest.update(b, off, result);
          }
          return result;
      }
docs: Reads into a byte array, and updates the message digest (if the
  digest function is on).  That is, this method reads up to
  {@code len} bytes from the input stream into the array
  {@code b}, starting at offset {@code off}. This method
  blocks until the data 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 data.
  
  @param b the array into which the data is read.
  
  @param off the starting offset into {@code b} of where the
  data should be placed.
  
  @param len the maximum number of bytes to be read from the input
  stream into b, starting at offset {@code off}.
  
  @return  the actual number of bytes read. This is less than
  {@code len} if the end of the stream is reached prior to
  reading {@code len} bytes. -1 is returned if no bytes were
  read because the end of the stream had already been reached when
  the call was made.
  
  @exception IOException if an I/O error occurs.
  
  @see MessageDigest#update(byte[], int, int)