in src/java/org/apache/fulcrum/jce/crypto/StreamUtil.java [150:169]
public static long copy( InputStream is, OutputStream os )
throws IOException
{
byte[] buf = new byte[BUFFER_SIZE];
int n = 0;
long total = 0;
while ((n = is.read(buf)) > 0)
{
os.write(buf, 0, n);
total += n;
}
is.close();
os.flush();
os.close();
return total;
}