Class HashingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.google.common.hash.HashingOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
An 
OutputStream that maintains a hash of the data written to it.- Since:
- 16.0
- Author:
- Zoe Piepmeier
- 
Field SummaryFields inherited from class java.io.FilterOutputStreamout
- 
Constructor SummaryConstructorsConstructorDescriptionHashingOutputStream(HashFunction hashFunction, OutputStream out) Creates an output stream that hashes using the givenHashFunction, and forwards all data written to it to the underlyingOutputStream.
- 
Method SummaryMethods inherited from class java.io.FilterOutputStreamflush, writeMethods inherited from class java.io.OutputStreamnullOutputStream
- 
Constructor Details- 
HashingOutputStreamCreates an output stream that hashes using the givenHashFunction, and forwards all data written to it to the underlyingOutputStream.The OutputStreamshould not be written to before or after the hand-off.
 
- 
- 
Method Details- 
write- Overrides:
- writein class- FilterOutputStream
- Throws:
- IOException
 
- 
write- Overrides:
- writein class- FilterOutputStream
- Throws:
- IOException
 
- 
hash
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- FilterOutputStream
- Throws:
- IOException
 
 
-