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} 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 original digest untouched.
73 * The message digest associated with this stream.
75 protected MessageDigest digest;
78 * Creates a digest input stream, using the specified input stream
79 * and message digest.
83 * @param digest the message digest to associate with this stream.
85 public DigestInputStream(InputStream stream, MessageDigest digest) {
87 setMessageDigest(digest);
91 * Returns the message digest associated with this stream.
93 * @return the message digest associated with this stream.
97 return digest;
101 * Associates the specified message digest with this stream.
103 * @param digest the message digest to be associated with this stream.
106 public void setMessageDigest(MessageDigest digest) {
107 this.digest = digest;
111 * Reads a byte, and updates the message digest (if the digest
114 * digest function is on (see {@link #on(boolean) on}), this method
115 * will then call {@code update} on the message digest associated
127 digest.update((byte)ch);
133 * Reads into a byte array, and updates the message digest (if the
134 * digest function is on). That is, this method reads up to
138 * read. If the digest function is on (see
140 * on the message digest associated with this stream, passing it
164 digest.update(b, off, result);
170 * Turns the digest function on or off. The default is on. When
172 * update on the message digest. But when it is off, the message
173 * digest is not updated.
175 * @param on true to turn the digest function on, false to turn
183 * Prints a string representation of this digest input stream and
184 * its associated message digest object.
187 return "[Digest Input Stream] " + digest.toString();