Package org.apache.jcp.xml.dsig.internal
Class DigesterOutputStream
java.lang.Object
java.io.OutputStream
org.apache.jcp.xml.dsig.internal.DigesterOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
This class has been modified slightly to use java.security.MessageDigest
objects as input, rather than
org.apache.xml.security.algorithms.MessageDigestAlgorithm objects.
It also optionally caches the input bytes.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a DigesterOutputStream.DigesterOutputStream(MessageDigest md, boolean buffer) Creates a DigesterOutputStream. -
Method Summary
Methods inherited from class java.io.OutputStream
flush, write
-
Constructor Details
-
DigesterOutputStream
Creates a DigesterOutputStream.- Parameters:
md- the MessageDigest
-
DigesterOutputStream
Creates a DigesterOutputStream.- Parameters:
md- the MessageDigestbuffer- if true, caches the input bytes
-
-
Method Details
-
write
public void write(int input) - Specified by:
writein classOutputStream
-
write
public void write(byte[] input, int offset, int len) - Overrides:
writein classOutputStream
-
getDigestValue
public byte[] getDigestValue()- Returns:
- the digest value
-
getInputStream
- Returns:
- an input stream containing the cached bytes, or null if not cached
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-