docs: protected OutputStream getOutputStream(boolean useStdOut, String filePath,
  			String compressionType) throws IOException {
  		if (useStdOut) {
  			return System.out;
  		}
  
  		if (!compressionType.isEmpty()) {
  			filePath += "." + compressionType;
  		}
  
  		Path outputDirectory = Paths.get(filePath).getParent();
  		if (outputDirectory == null) {
  			outputDirectory = Paths.get(".");
  		}
  
  		DirectoryManager dm = DirectoryManagerFactory.createDirectoryManager(
  				outputDirectory, false);
  		OutputStream out = dm.getOutputStreamForFile(Paths.get(filePath)
  				.getFileName().toString());
  
  		OutputStream bufferedFileOutputStream = new BufferedOutputStream(out,
  				1024 * 1024 * 5);
  
  		switch (compressionType) {
  		case COMPRESS_BZ2:
  			return getAsynchronousOutputStream(new BZip2CompressorOutputStream(
  					bufferedFileOutputStream));
  		case COMPRESS_GZIP:
  			GzipParameters gzipParameters = new GzipParameters();
  			gzipParameters.setCompressionLevel(7);
  			return getAsynchronousOutputStream(new GzipCompressorOutputStream(
  					bufferedFileOutputStream, gzipParameters));
  		case COMPRESS_NONE:
  			return bufferedFileOutputStream;
  		default:
  			bufferedFileOutputStream.close();
  			throw new IllegalArgumentException(
  					"Unsupported compression format: " + compressionType);
  		}
  	}