Package aQute.libg.cryptography
Class Digester<T extends Digest>
- java.lang.Object
-
- java.io.OutputStream
-
- aQute.libg.cryptography.Digester<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public abstract class Digester<T extends Digest> extends java.io.OutputStream
-
-
Constructor Summary
Constructors Constructor Description Digester(java.security.MessageDigest instance, java.io.OutputStream... out)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Tdigest()abstract Tdigest(byte[] bytes)Tfrom(byte[] f)Tfrom(java.io.File f)Tfrom(java.io.InputStream in)abstract java.lang.StringgetAlgorithm()intgetLength()java.security.MessageDigestgetMessageDigest()voidsetOutputs(java.io.OutputStream... out)voidwrite(byte[] buffer, int offset, int length)voidwrite(int b)
-
-
-
Method Detail
-
write
public void write(byte[] buffer, int offset, int length) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
getMessageDigest
public java.security.MessageDigest getMessageDigest() throws java.lang.Exception- Throws:
java.lang.Exception
-
from
public T from(java.io.InputStream in) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setOutputs
public void setOutputs(java.io.OutputStream... out)
-
digest
public abstract T digest() throws java.lang.Exception
- Throws:
java.lang.Exception
-
digest
public abstract T digest(byte[] bytes) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getAlgorithm
public abstract java.lang.String getAlgorithm()
-
from
public T from(java.io.File f) throws java.lang.Exception
- Throws:
java.lang.Exception
-
from
public T from(byte[] f) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getLength
public int getLength()
-
-