Skip to content

BitMemCompressor

Oz edited this page Apr 28, 2017 · 18 revisions

The BitMemCompressor class allows to compress memory buffers to the filesystem or to other memory buffers. It let decide various properties of the produced archive file, such as the password protection and the compression level desired.

#include "bitmemcompressor.hpp"

inherits from BitArchiveCreator

List of all members

Public Members

Return type Name
BitMemCompressor( Bit7zLibrary const &lib, BitInOutFormat const &format )
void compress( const vector< byte_t > &in_buffer, const wstring &out_archive, wstring in_buffer_name=L"" ) const
void compress( const vector< byte_t > &in_buffer, vector< byte_t > &out_buffer, wstring in_buffer_name=L"" ) const

Member Function Documentation

BitMemCompressor( Bit7zLibrary const &lib, BitInOutFormat const &format )

Constructs a BitMemCompressor object.

The Bit7zLibrary parameter is needed in order to have access to the functionalities of the 7z DLLs. On the other hand, the BitInOutFormat is required in order to know the format of the output archive.


void compress( const vector< byte_t > &in_buffer, const wstring &out_archive, wstring in_buffer_name=L"" ) const

Compresses the given buffer to an archive on the filesystem.


void compress( const vector< byte_t > &in_buffer, vector< byte_t > &out_buffer, wstring in_buffer_name=L"" ) const

Compresses the given input buffer to the output buffer.

Note: If the format of the output doesn't support in memory compression, a BitException is thrown.


Clone this wiki locally