final boolean allowCompressed) {
try {
// we cannot merge compressed outputs, so don't compress if allowCompressed is false,
// which is the case when we have a temporary output file for later merging
if ( allowCompressed && stub.isCompressed() )
stream = new BlockCompressedOutputStream(file);
else
stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE));
}
catch(IOException ex) {
throw new UserException.CouldNotCreateOutputFile(file, "Unable to open target output stream", ex);