Package ghidra.util
Class HashingOutputStream
java.lang.Object
java.io.OutputStream
ghidra.util.HashingOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
A filtering
OutputStream
that calculates the hash of the bytes being
written.
Call getDigest()
to retrieve the hash value bytes.
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
HashingOutputStream
- Parameters:
out
- - OutputStream to wraphashAlgo
- - seeMessageDigest.getInstance(String)
, ie. "MD5".- Throws:
NoSuchAlgorithmException
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
getDigest
public byte[] getDigest()
-