Brotli-Compression-Decompression-for-Delphi-Lazarus
Brotli Compression Decompression for Delphi, Lazarus and Free Pascal
- Active · last change 10-26-2026
- ★ 5 on GitHub
README
Switch to a Free Pascal port of Brotli: https://github.com/Xelitan/Free-Pascal-port-of-Brotli
Brotli-Compression-Decompression-for-Delphi-Lazarus
Brotli Compression Decompression for Delphi, Lazarus and Free Pascal, using a DLL
Usage examples
var F,S: TFileStream;
OrigSize: Integer;
begin
F := TFileStream.Create('input.txt', fmOpenRead);
S := TFileStream.Create('output.snap', fmCreate);
Brotli(F, S);
OrigSize := F.Size;
F.Free;
S.Free;
F := TFileStream.Create('output.snap', fmOpenRead);
S := TFileStream.Create('output.txt', fmCreate);
UnBrotli(F, S, OrigSize);
F.Free;
S.Free;
end;This unit uses Brotli library by Google:
Brotli is open-sourced under the MIT License.
Linux (Debian, Ubuntu, Mint)
- apt install apt-file libbrotli-dev
- apt-file search libbrotli.so It will list you how your libbrotli.so files are named exactly and where they are
- Open BrotliLib.pas and edit "const BROTLI_LIB"
- Change the value of that const. Enter filename (excluding path) found in step 2
- Compile and run

