public final class HashingOutputStream extends FilterOutputStream
out| Constructor and Description |
|---|
HashingOutputStream(String algorithm,
OutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
byte[] |
getDigest() |
String |
getHashAsString() |
static String |
hashString(byte[] bytes) |
static HashingOutputStream |
sha1(OutputStream out) |
void |
write(int b) |
flush, write, writepublic HashingOutputStream(String algorithm, OutputStream out) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic static HashingOutputStream sha1(OutputStream out) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionpublic byte[] getDigest()
public void write(int b)
throws IOException
write in class FilterOutputStreamIOExceptionpublic String getHashAsString() throws IOException
IOExceptionpublic static String hashString(byte[] bytes)
Copyright © 2015. All Rights Reserved.