class CompressManager {

    public Compress getCompress(int compressType) {
        if (compressType < 0 || compressType >= compressNum) {
            throw new RuntimeException("out of bound");
        }
        Compress compress = compressArray[compressType];
        if (compress == null) {
            String errMsg = String.format("compress type=%d not support", compressType);
            log.warn(errMsg);
            throw new RuntimeException(errMsg);
        }
        return compress;
    }

    private  CompressManager();

}