Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++DelphiTech Partner

Flexible Brotli Compression Library For Your Windows Delphi/C++ Builder VCL And FMX Apps

Intro

Most of Delphi and C++ Builder developers utilize preinstalled components and libraries to compress and decompress files. For instance, the System.Zlib which supports gzip and deflate, the System.Zip is also helpful to handle .zip archive files. Moreover, Indy’s TIdCompressorZLib which is based on Zlib. 

But that is not it. There are more different libraries based on different compression algorithms and more modern techniques, for instance, the Brotli – Brotli is similar in speed with deflate but offers more impenetrable compression. Brotli is open-sourced under the MIT License by Google. Brotli compressed files have .br extension.

To connect your Delphi or C++ Builder VCL and FMX application with the Brotli library we can rely on Brotli Compress library from WINSOFT which offers to use the Brotli library easily.

Brotli itself is free to use and distribute, but the Brotli Compress by WINSOFT is a commercial library and if you would like to use that library you should get a license!

Specifications

  • Uses Brotli library
  • Supports Windows 32 and Windows 64
  • Available for Delphi/C++ Builder 6 – 10.4

Installation

After downloading the Brotli from WINSOFT you should configure the library into your RAD Studio. You can follow the tutorial here that shows the steps to configure without errors.

Development

Since the Brotli itself is a whole compression library your application should have brotlilib.dll – Dynamic-link library. You will get those files within the Brotli Compressor by WINSOFT in a Library Folder.

Brotli Compressor Library has two main classes:

  1. TBrotliEncoder 
  2. TBrotliDecoder

As you can observe the TBrotliEncoder encodes and TBrotliDecoder decodes the files with the given parameters. Furthermore, the OnProgress event provides the decompression and compression progress info.

Additionally, you can set encoding quality with the Quality property.

Here is the Brotli library demonstration video that shows the demo application in action. 

These are demo projects’ UI:

DEMO UI

This is how you can encode with Brotli:

Here is how you can decode with the Brotli:

As you can see this is uncomplicated and you just need to implement the file selection process and input/output streams.

Head over and check out the full WINSOFT Brotli Compression Library!


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Software Developer | CS(CyberSec) Undergrad at APU Malaysia | Delphi/C++ Builder Enthusiast | Microsoft Learn Student Ambassador | Microsoft Azure Certified

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES