package org.ibex.io;
import java.io.*;
+import org.ibex.crypto.*;
/** package-private class */
abstract class ByteBufInputStream extends InputStream {
private byte[] buf = new byte[8192];
private int start = 0;
private int end = 0;
+ public Digest digest = null;
public ByteBufInputStream(InputStream is) {
this.is = is;
start = end = 0;
continue;
}
+ } else {
+ if (digest != null) digest.update(buf, 0, end);
}
} while(end==0);
if (end == -1) { end = 0; return -1; }
import java.util.*;
import java.util.zip.*;
import org.ibex.util.*;
+import org.ibex.crypto.*;
// Features:
// - automatically flush writer before reading on linked read/write pairs
public void setNewline(String s) { newLine = s; }
public InputStream getInputStream() { return in; }
+ public void setInputDigest(Digest d) { in.bbis.digest = d; }
+
private static class Out extends BufferedOutputStream {
private Writer writer = new OutputStreamWriter(this);
public Out(OutputStream out) { super(out); }