Latest bnd code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1350613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/libg/cryptography/Digester.java b/bundleplugin/src/main/java/aQute/libg/cryptography/Digester.java
index eeb2c8f..2785c3d 100644
--- a/bundleplugin/src/main/java/aQute/libg/cryptography/Digester.java
+++ b/bundleplugin/src/main/java/aQute/libg/cryptography/Digester.java
@@ -7,41 +7,45 @@
public abstract class Digester<T extends Digest> extends OutputStream {
protected MessageDigest md;
- OutputStream out[];
-
- public Digester(MessageDigest instance, OutputStream ... out) {
+ OutputStream out[];
+
+ public Digester(MessageDigest instance, OutputStream... out) {
md = instance;
this.out = out;
}
-
+
@Override
- public void write( byte[] buffer, int offset, int length) throws IOException{
- md.update(buffer,offset,length);
- for ( OutputStream o : out ) {
+ public void write(byte[] buffer, int offset, int length) throws IOException {
+ md.update(buffer, offset, length);
+ for (OutputStream o : out) {
o.write(buffer, offset, length);
}
}
+
@Override
- public void write( int b) throws IOException{
+ public void write(int b) throws IOException {
md.update((byte) b);
- for ( OutputStream o : out ) {
+ for (OutputStream o : out) {
o.write(b);
}
}
-
+
public MessageDigest getMessageDigest() throws Exception {
return md;
}
-
+
public T from(InputStream in) throws Exception {
- IO.copy(in,this);
+ IO.copy(in, this);
return digest();
}
-
- public void setOutputs(OutputStream ...out) {
+
+ public void setOutputs(OutputStream... out) {
this.out = out;
}
+
public abstract T digest() throws Exception;
- public abstract T digest( byte [] bytes) throws Exception;
+
+ public abstract T digest(byte[] bytes) throws Exception;
+
public abstract String getAlgorithm();
}