static Builder<? extends Compression> of(final CompressionType compressionType) {
        switch (compressionType) {
            case NONE:
                return none();
            case GZIP:
                return gzip();
            case SNAPPY:
                return snappy();
            case LZ4:
                return lz4();
            case ZSTD:
                return zstd();
            default:
                throw new IllegalArgumentException("Unknown compression type: " + compressionType.name);
        }
    }
Recommended size of buffer for storing decompressed output.
clients/src/main/java/org/apache/kafka/common/compress/Compression.java