Package com.mastfrog.util.streams
Class HashingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.mastfrog.util.streams.HashingOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Output stream which wraps another output stream and computes a cryptographic
hash using some algorithm as the data arrives.
- Author:
- Tim Boudreau
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()byte[]static StringhashString(byte[] bytes) static HashingOutputStreamsha1(OutputStream out) voidwrite(int b) Methods inherited from class java.io.FilterOutputStream
flush, write, writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
HashingOutputStream
-
-
Method Details
-
sha1
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
getDigest
public byte[] getDigest() -
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
getHashAsString
- Throws:
IOException
-
hashString
-