Package org.nuxeo.ecm.core.blob
Class KeyStrategyDigest.WriteObserverDigest
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.KeyStrategyDigest.WriteObserverDigest
-
- All Implemented Interfaces:
KeyStrategy.WriteObserver
- Enclosing class:
- KeyStrategyDigest
public static class KeyStrategyDigest.WriteObserverDigest extends Object implements KeyStrategy.WriteObserver
Write observer computing a digest. The final digest is made available to the key consumer.- Since:
- 11.1
-
-
Field Summary
Fields Modifier and Type Field Description protected DigestOutputStream
dos
protected Consumer<String>
keyConsumer
protected MessageDigest
messageDigest
-
Constructor Summary
Constructors Constructor Description WriteObserverDigest(String digestAlgorithm, Consumer<String> keyConsumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
done()
Must be called when writes to the wrapped stream are done, to complete observation.OutputStream
wrap(OutputStream out)
Wraps the given stream to observe it.
-
-
-
Field Detail
-
messageDigest
protected final MessageDigest messageDigest
-
dos
protected DigestOutputStream dos
-
-
Method Detail
-
wrap
public OutputStream wrap(OutputStream out)
Description copied from interface:KeyStrategy.WriteObserver
Wraps the given stream to observe it.- Specified by:
wrap
in interfaceKeyStrategy.WriteObserver
-
done
public void done()
Description copied from interface:KeyStrategy.WriteObserver
Must be called when writes to the wrapped stream are done, to complete observation.- Specified by:
done
in interfaceKeyStrategy.WriteObserver
-
-