format/src/main/java/com/github/sadikovi/riff/io/CompressionCodecFactory.java
/**
   * Decode flag into supported compression codec.
   * @param flag byte flag
   * @return compression codec
   */
Decode flag into supported compression codec.
@param flag byte flag
@return compression codec
Decode flag into supported compression codec . @param flag byte flag @return compression codec
public static CompressionCodec decode(byte flag) {
    if (flag == UNCOMPRESSED_ENCODE_FLAG) return UNCOMPRESSED;
    if (flag == ZLIB_ENCODE_FLAG) return new ZlibCodec();
    if (flag == GZIP_ENCODE_FLAG) return new GzipCodec();
    if (flag == SNAPPY_ENCODE_FLAG) return new SnappyCodec();
    throw new UnsupportedOperationException("Unknown codec flag: " + flag);
  }
public static CompressionCodec decode ( byte flag ) { if ( flag == UNCOMPRESSED_ENCODE_FLAG ) return UNCOMPRESSED ; if ( flag == ZLIB_ENCODE_FLAG ) return new ZlibCodec ( ) ; if ( flag == GZIP_ENCODE_FLAG ) return new GzipCodec ( ) ; if ( flag == SNAPPY_ENCODE_FLAG ) return new SnappyCodec ( ) ; throw new UnsupportedOperationException ( "Unknown codec flag: " + flag ) ; }
Decode flag into supported compression codec.
Decode flag into supported compression codec .
// return zlib codec with default settings