public static class MessageDigestCalculatingInputStream.Builder extends AbstractStreamBuilder<MessageDigestCalculatingInputStream,MessageDigestCalculatingInputStream.Builder>
MessageDigestCalculatingInputStream instance.
For example:
MessageDigestCalculatingInputStream s = MessageDigestCalculatingInputStream.builder()
.setPath(path)
.setMessageDigest("SHA-512")
.get()
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
MessageDigestCalculatingInputStream |
get()
Constructs a new instance.
|
void |
setMessageDigest(MessageDigest messageDigest)
Sets the message digest.
|
void |
setMessageDigest(String algorithm)
Sets the name of the name of the message digest algorithm.
|
getBufferSize, getBufferSizeDefault, getCharset, getCharsetDefault, setBufferSize, setBufferSize, setBufferSizeDefault, setCharset, setCharset, setCharsetDefaultcheckOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setReader, setURI, setWriterasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplierpublic Builder()
public MessageDigestCalculatingInputStream get() throws IOException
UnsupportedOperationException - if the origin cannot be converted to an InputStream.IOException - if an I/O error occurs.public void setMessageDigest(MessageDigest messageDigest)
messageDigest - the message digest.public void setMessageDigest(String algorithm) throws NoSuchAlgorithmException
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.NoSuchAlgorithmException - if no Provider supports a MessageDigestSpi implementation for the specified algorithm.Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.