Package org.bouncycastle.crypto.io
Class DigestOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.bouncycastle.crypto.io.DigestOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class DigestOutputStream extends OutputStream
-
-
Constructor Summary
Constructors Constructor Description DigestOutputStream(Digest Digest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getDigest()voidwrite(byte[] b, int off, int len)Writescountbytes from the byte arraybufferstarting at positionoffsetto this stream.voidwrite(int b)Writes a single byte to this stream.-
Methods inherited from class java.io.OutputStream
close, flush, write
-
-
-
-
Field Detail
-
digest
protected Digest digest
-
-
Constructor Detail
-
DigestOutputStream
public DigestOutputStream(Digest Digest)
-
-
Method Detail
-
write
public void write(int b) throws IOExceptionDescription copied from class:OutputStreamWrites a single byte to this stream. Only the least significant byte of the integeroneByteis written to the stream.- Specified by:
writein classOutputStream- Parameters:
b- the byte to be written.- Throws:
IOException- if an error occurs while writing to this stream.
-
write
public void write(byte[] b, int off, int len) throws IOExceptionDescription copied from class:OutputStreamWritescountbytes from the byte arraybufferstarting at positionoffsetto this stream.- Overrides:
writein classOutputStream- Parameters:
b- the buffer to be written.off- the start position inbufferfrom where to get bytes.len- the number of bytes frombufferto write to this stream.- Throws:
IOException- if an error occurs while writing to this stream.
-
getDigest
public byte[] getDigest()
-
-