}
//Create the corresponding file and open it
file.createNewFile();
GeneralFileOutputStream fos = FileFactory.newFileOutputStream(file);
// Read through a digest input stream that will work out the MD5
DigestInputStream dis = null;
try
{
dis = new DigestInputStream(is, MessageDigest.getInstance("MD5"));
}
// Should never happen
catch (NoSuchAlgorithmException nsae)
{
log.warn("Caught NoSuchAlgorithmException", nsae);
}
Utils.bufferedCopy(dis, fos);
fos.close();
is.close();
bitstream.setColumn("size_bytes", file.length());
if (dis != null)