code: private static FSImageCompression createCompression(Configuration conf,
                                                        String codecClassName)
      throws IOException {
  
      CompressionCodecFactory factory = new CompressionCodecFactory(conf);
      CompressionCodec codec = factory.getCodecByClassName(codecClassName);
      if (codec == null) {
        throw new IOException("Not a supported codec: " + codecClassName);
      }
  
      return new FSImageCompression(codec);
    }
docs: Create a compression instance using the codec specified by
  <code>codecClassName</code>