public static class MessageDigestCalculatingInputStream.Builder extends ObservableInputStream.AbstractBuilder<MessageDigestCalculatingInputStream.Builder>
MessageDigestCalculatingInputStream.
For example:
MessageDigestCalculatingInputStream s = MessageDigestCalculatingInputStream.builder()
.setPath(path)
.setMessageDigest("SHA-512")
.get();
The MD5 cryptographic algorithm is weak and should not be used.
get()| Constructor and Description |
|---|
Builder()
Constructs a new builder of
MessageDigestCalculatingInputStream. |
| Modifier and Type | Method and Description |
|---|---|
MessageDigestCalculatingInputStream |
get()
Builds a new
MessageDigestCalculatingInputStream. |
void |
setMessageDigest(java.security.MessageDigest messageDigest)
Sets the message digest.
|
void |
setMessageDigest(java.lang.String algorithm)
Sets the name of the name of the message digest algorithm.
|
setObserversgetBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeMax, setCharset, setCharset, setOpenOptionssetByteArray, setCharSequence, setFile, setFile, setInputStream, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplier, getUncheckedpublic Builder()
MessageDigestCalculatingInputStream.
The default for compatibility is the MD5 cryptographic algorithm which is weak and should not be used.
public MessageDigestCalculatingInputStream get() throws java.io.IOException
MessageDigestCalculatingInputStream.
You must set an aspect that supports AbstractStreamBuilder.getInputStream(), otherwise, this method throws an exception.
This builder uses the following aspects:
AbstractStreamBuilder.getInputStream() gets the target aspect.MessageDigestjava.lang.NullPointerException - if messageDigest is null.java.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to an InputStream.java.io.IOException - if an I/O error occurs converting to an InputStream using AbstractStreamBuilder.getInputStream().AbstractStreamBuilder.getInputStream(),
IOSupplier.getUnchecked()public void setMessageDigest(java.security.MessageDigest messageDigest)
The MD5 cryptographic algorithm is weak and should not be used.
messageDigest - the message digest.public void setMessageDigest(java.lang.String algorithm)
throws java.security.NoSuchAlgorithmException
The MD5 cryptographic algorithm is weak and should not be used.
algorithm - the name of the algorithm. See the MessageDigest section in the
Java Cryptography
Architecture Standard Algorithm Name Documentation for information about standard algorithm names.java.security.NoSuchAlgorithmException - if no Provider supports a MessageDigestSpi implementation for the specified algorithm.Copyright © 2010 - 2025 Adobe. All Rights Reserved