![]() ![]() If 0, the default compression level (50, or another value as set through wimlib_set_default_compression_level()) is used. However, some compression types have looser requirements regarding this. In general, the same value of max_block_size must be passed to wimlib_create_decompressor() when the data is later decompressed. This parameter must be at least 1 and must be less than or equal to a compression-type-specific limit. wimlib_get_compressor_needed_memory() can be used to query the specific amount of memory that will be required. ![]() Usually, the amount of memory used by the compressor will scale in proportion to the max_block_size parameter. This specifies the maximum allowed value for the uncompressed_size parameter of wimlib_compress() when called using this compressor. The maximum compression block size to support. Parameters ctypeĬompression type for which to create the compressor, as one of the wimlib_compression_type constants. ![]() This function is part of wimlib's compression API it is not necessary to call this to process a WIM file. Return values WIMLIB_ERR_INVALID_COMPRESSION_TYPEĬtype was neither a supported compression type nor -1.Īllocate a compressor for the specified compression type using the specified parameters. Returns 0 on success a wimlib_error_code value on failure. See wimlib_create_compressor() for more information. Otherwise, a higher value indicates higher compression, whereas a lower value indicates lower compression. If 0, the "default default" level of 50 is restored. Or, if this is the special value -1, the default compression levels for all compression types will be set. Parameters ctypeĬompression type for which to set the default compression level, as one of the wimlib_compression_type constants. The initial state, before this function is called, is that all compression types have a default compression level of 50. Therefore, calling this function will affect the compression level of any data later written to WIM files using the specified compression type. wimlib_write()) will pass 0 to wimlib_create_compressor() internally. This is the compression level that wimlib_create_compressor() assumes if it is called with compression_level specified as 0. Set the default compression level for the specified compression type. Macro Definition Documentation ◆ WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE The main limitation is the lack of sliding window support this has, however, allowed the algorithms to be optimized for block-based compression. They are implemented in highly optimized C code, using state-of-the-art compression techniques. But they are exported and documented so that they can be used in other applications or libraries for general-purpose lossless data compression. These functions are already used by wimlib internally when appropriate for reading and writing WIM archives. Wimlib_free_decompressor (struct wimlib_decompressor *decompressor)įree a decompressor previously allocated with wimlib_create_decompressor(). Wimlib_decompress (const void *compressed_data, size_t compressed_size, void *uncompressed_data, size_t uncompressed_size, struct wimlib_decompressor *decompressor) Wimlib_create_decompressor (enum wimlib_compression_type ctype, size_t max_block_size, struct wimlib_decompressor **decompressor_ret)Īllocate a decompressor for the specified compression type. Wimlib_free_compressor (struct wimlib_compressor *compressor)įree a compressor previously allocated with wimlib_create_compressor(). Wimlib_compress (const void *uncompressed_data, size_t uncompressed_size, void *compressed_data, size_t compressed_size_avail, struct wimlib_compressor *compressor) Wimlib_create_compressor (enum wimlib_compression_type ctype, size_t max_block_size, unsigned int compression_level, struct wimlib_compressor **compressor_ret)Īllocate a compressor for the specified compression type using the specified parameters. ![]() Return the approximate number of bytes needed to allocate a compressor with wimlib_create_compressor() for the specified compression type, maximum block size, and compression level. Wimlib_get_compressor_needed_memory (enum wimlib_compression_type ctype, size_t max_block_size, unsigned int compression_level) Wimlib_set_default_compression_level (int ctype, unsigned int compression_level) WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE 0x80000000 String newFile = "/Users/pankaj/new_sitemap.Functions for XPRESS, LZX, and LZMS compression and decompression. String file = "/Users/pankaj/sitemap.xml" Here is a simple java GZIP example program showing how can we compress a file to GZIP format and then decompress the GZIP file to create a new file. We can compress a single file in GZIP format but we can’t compress and archive a directory using GZIP like ZIP files. GZIP is one of the favorite tool to compress file in Unix systems. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |