format/src/main/java/com/github/sadikovi/riff/io/CompressionCodecFactory.java
/**
   * Get encoded byte flag for compression codec.
   * @param codec compression codec
   * @return byte flag
   */
Get encoded byte flag for compression codec.
@param codec compression codec
@return byte flag
Get encoded byte flag for compression codec . @param codec compression codec @return byte flag
public static byte encode(CompressionCodec codec) {
    if (codec == UNCOMPRESSED) return UNCOMPRESSED_ENCODE_FLAG;
    if (codec instanceof ZlibCodec) return ZLIB_ENCODE_FLAG;
    if (codec instanceof GzipCodec) return GZIP_ENCODE_FLAG;
    if (codec instanceof SnappyCodec) return SNAPPY_ENCODE_FLAG;
    throw new UnsupportedOperationException("Unknown codec: " + codec);
  }
public static byte encode ( CompressionCodec codec ) { if ( codec == UNCOMPRESSED ) return UNCOMPRESSED_ENCODE_FLAG ; if ( codec instanceof ZlibCodec ) return ZLIB_ENCODE_FLAG ; if ( codec instanceof GzipCodec ) return GZIP_ENCODE_FLAG ; if ( codec instanceof SnappyCodec ) return SNAPPY_ENCODE_FLAG ; throw new UnsupportedOperationException ( "Unknown codec: " + codec ) ; }
Get encoded byte flag for compression codec.
Get encoded byte flag for compression codec .
// return flag as power of 2