Function compressToBuffer

Synopsis

#include <include/bitarchivecreator.hpp>

void compressToBuffer(vector< byte_t > &out_buffer, UpdateCallback *update_callback) const

Description

No description yet.

Source

Lines 282-294 in src/bitarchivecreator.cpp. Line 199 in include/bitarchivecreator.hpp.

void BitArchiveCreator::compressToBuffer( vector< byte_t >& out_buffer, UpdateCallback* update_callback ) const {
    if ( !mFormat.hasFeature( INMEM_COMPRESSION ) ) {
        throw BitException( kUnsupportedInMemoryFormat, ERROR_NOT_SUPPORTED );
    }

    if ( !out_buffer.empty() ) {
        throw BitException( kCannotOverwriteBuffer, E_INVALIDARG );
    }

    CMyComPtr< IOutArchive > new_arc = initOutArchive();
    CMyComPtr< ISequentialOutStream > out_mem_stream = new CBufOutStream( out_buffer );
    compressOut( new_arc, out_mem_stream, update_callback );
}





Add Discussion as Guest

Log in