Lines Matching defs:digest

36  * A transparent stream that updates the associated message digest using
39 * <p>To complete the message digest computation, call one of the
40 * <code>digest</code> methods on the associated message
41 * digest after your calls to one of this digest input stream's
47 * results in an update on the message digest. But when it is off,
48 * the message digest is not updated. The default is for the stream
51 * <p>Note that digest objects can compute only one digest (see
54 * retain a handle onto the digest object, and clone it for each
55 * digest to be computed, leaving the orginal digest untouched.
72 * The message digest associated with this stream.
74 protected MessageDigest digest;
77 * Creates a digest input stream, using the specified input stream
78 * and message digest.
82 * @param digest the message digest to associate with this stream.
84 public DigestInputStream(InputStream stream, MessageDigest digest) {
86 setMessageDigest(digest);
90 * Returns the message digest associated with this stream.
92 * @return the message digest associated with this stream.
96 return digest;
100 * Associates the specified message digest with this stream.
102 * @param digest the message digest to be associated with this stream.
105 public void setMessageDigest(MessageDigest digest) {
106 this.digest = digest;
110 * Reads a byte, and updates the message digest (if the digest
113 * digest function is on (see {@link #on(boolean) on}), this method
114 * will then call <code>update</code> on the message digest associated
126 digest.update((byte)ch);
132 * Reads into a byte array, and updates the message digest (if the
133 * digest function is on). That is, this method reads up to
137 * read. If the digest function is on (see
139 * on the message digest associated with this stream, passing it
163 digest.update(b, off, result);
169 * Turns the digest function on or off. The default is on. When
171 * update on the message digest. But when it is off, the message
172 * digest is not updated.
174 * @param on true to turn the digest function on, false to turn
182 * Prints a string representation of this digest input stream and
183 * its associated message digest object.
186 return "[Digest Input Stream] " + digest.toString();