private OutputStream compressedOutputStream(File outputFile) throws IOException {
        return switch (type) {
            case compressed -> switch (compressionType) {
                case gzip -> new GZIPOutputStream(new FileOutputStream(outputFile));
                case lz4 -> new LZ4BlockOutputStream(new FileOutputStream(outputFile));
                case none -> new FileOutputStream(outputFile);
                case zstd -> new ZstdOutputStream(new FileOutputStream(outputFile));
            };
            case file -> new FileOutputStream(outputFile);
        };
    }
Utility class for compressing and decompressing files used in a file reference

@author hmusum
filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceCompressor.java