- java.lang.Object
-
- java.io.OutputStream
-
- io.github.mmm.crypto.io.OutputStreamWrapper
-
- io.github.mmm.crypto.hash.HashOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class HashOutputStream extends OutputStreamWrapper
AnOutputStream
that writes to aMessageDigest
. UnlikeDigestOutputStream
it does not wrap anOutputStream
to write through.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description HashOutputStream(HashCreator hashGenerator)
The constructor.HashOutputStream(HashCreator hashGenerator, OutputStream delegate)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(byte[] b, int off, int len)
void
write(int b)
-
Methods inherited from class io.github.mmm.crypto.io.OutputStreamWrapper
close, getDelegate, isClosed, requireNotClosed, write
-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
-
-
-
Constructor Detail
-
HashOutputStream
public HashOutputStream(HashCreator hashGenerator)
The constructor.- Parameters:
hashGenerator
- theHashCreator
.
-
HashOutputStream
public HashOutputStream(HashCreator hashGenerator, OutputStream delegate)
The constructor.- Parameters:
hashGenerator
- theHashCreator
.delegate
- thedelegate
. May benull
.
-
-
Method Detail
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classOutputStreamWrapper
- Throws:
IOException
-
write
public void write(int b) throws IOException
- Overrides:
write
in classOutputStreamWrapper
- Throws:
IOException
-
-