Package org.nuxeo.ecm.core.blob.binary
Class AESBinaryManager.CipherAndDigestOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.nuxeo.ecm.core.blob.binary.AESBinaryManager.CipherAndDigestOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Enclosing class:
- AESBinaryManager
public static class AESBinaryManager.CipherAndDigestOutputStream extends FilterOutputStream
ACipherOutputStream
that also does a digest of the original stream at the same time.
-
-
Field Summary
Fields Modifier and Type Field Description protected Cipher
cipher
protected byte[]
digest
protected MessageDigest
messageDigest
protected OutputStream
out
-
Constructor Summary
Constructors Constructor Description CipherAndDigestOutputStream(OutputStream out, Cipher cipher, MessageDigest messageDigest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
byte[]
getDigest()
void
write(byte[] b, int off, int len)
void
write(int b)
-
Methods inherited from class java.io.FilterOutputStream
write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
cipher
protected Cipher cipher
-
out
protected OutputStream out
-
messageDigest
protected MessageDigest messageDigest
-
digest
protected byte[] digest
-
-
Constructor Detail
-
CipherAndDigestOutputStream
public CipherAndDigestOutputStream(OutputStream out, Cipher cipher, MessageDigest messageDigest)
-
-
Method Detail
-
getDigest
public byte[] getDigest()
-
write
public void write(int b) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
-