Function setCompressionMethod


#include <include/bitarchivecreator.hpp>

void setCompressionMethod(BitCompressionMethod compression_method)


Sets the compression method to be used when creating an archive.


compression_method - the compression method desired.


Lines 178-188 in src/bitarchivecreator.cpp. Line 147 in include/bitarchivecreator.hpp.

void BitArchiveCreator::setCompressionMethod( BitCompressionMethod compression_method ) {
    if ( !isValidCompressionMethod( mFormat, compression_method ) ) {
        throw BitException( "Invalid compression method for the chosen archive format", E_INVALIDARG );
    if ( mFormat.hasFeature( MULTIPLE_METHODS ) ) {
        /* even though the compression method is valid, we set it only if the format supports
         * different methods than the default one */
        mCompressionMethod = compression_method;
        mDictionarySize = 0; //reset dictionary size to default for the method

Add Discussion as Guest

Log in