} else {
tempFile = FileUtils.createTempFile("cos", "tmp", outputDir, false);
}
currentStream = new BufferedOutputStream(new FileOutputStream(tempFile));
bout.writeTo(currentStream);
inmem = false;
streamList.add(currentStream);
} catch (Exception ex) {
//Could be IOException or SecurityException or other issues.
//Don't care what, just keep it in memory.