{"id":16981368,"url":"https://github.com/charonn0/rb-liblzma","last_synced_at":"2026-02-25T23:04:16.304Z","repository":{"id":145922978,"uuid":"246417957","full_name":"charonn0/RB-liblzma","owner":"charonn0","description":"A Realbasic and Xojo binding to liblzma","archived":false,"fork":false,"pushed_at":"2024-07-07T22:45:14.000Z","size":170,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-07T01:08:02.548Z","etag":null,"topics":["compression","lzma","lzma2","realbasic","xojo","xz"],"latest_commit_sha":null,"homepage":"","language":"REALbasic","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charonn0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"charonn0"}},"created_at":"2020-03-10T22:04:52.000Z","updated_at":"2024-07-07T22:45:16.000Z","dependencies_parsed_at":"2024-06-22T16:49:12.873Z","dependency_job_id":"d80527be-a7f1-4ed0-88c1-b918e9a9d630","html_url":"https://github.com/charonn0/RB-liblzma","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/charonn0/RB-liblzma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-liblzma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-liblzma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-liblzma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-liblzma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charonn0","download_url":"https://codeload.github.com/charonn0/RB-liblzma/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-liblzma/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29844845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","lzma","lzma2","realbasic","xojo","xz"],"created_at":"2024-10-14T02:05:18.273Z","updated_at":"2026-02-25T23:04:16.268Z","avatar_url":"https://github.com/charonn0.png","language":"REALbasic","funding_links":["https://github.com/sponsors/charonn0"],"categories":[],"sub_categories":[],"readme":"## Introduction\n[liblzma](https://tukaani.org/xz/) is a free general purpose data compression library for the [LZMA](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm) compression algorithm. LZMA is the basis for the XZ compressed file format.\n\n**RB-liblzma** is a liblzma [binding](http://en.wikipedia.org/wiki/Language_binding) for Realbasic and Xojo projects.\n\nThe minimum supported liblzma version is 5.2.4. The minimum supported Xojo version is RS2009R3.\n\n## Hilights\n* Read and write compressed file or memory streams using a simple [BinaryStream work-alike](https://github.com/charonn0/RB-liblzma/wiki/LZMA.LZMAStream).\n* Supports LZMA2, LZMA1, and XZ compressed streams\n\n## Become a sponsor\nIf you use this code in a commercial project, or just want to show your appreciation, please consider sponsoring me through GitHub. https://github.com/sponsors/charonn0\n\n## Getting started\nThe recommended way to compress or decompress data is with the [`LZMAStream`](https://github.com/charonn0/RB-liblzma/wiki/LZMA.LZMAStream) class. The `LZMAStream` is a `BinaryStream` work-alike, and implements both the `Readable` and `Writeable` interfaces. Anything [written](https://github.com/charonn0/RB-liblzma/wiki/LZMA.LZMAStream.Write) to a `LZMAStream` is compressed and emitted to the output stream (another `Writeable`); [reading](https://github.com/charonn0/RB-liblzma/wiki/LZMA.LZMAStream.Read) from a `LZMAStream` decompresses data from the input stream (another `Readable`).\n\nInstances of `LZMAStream` can be created from MemoryBlocks, FolderItems, and objects that implement the `Readable` and/or `Writeable` interfaces. For example, creating an in-memory compression stream from a zero-length MemoryBlock and writing a string to it:\n\n```realbasic\n  Dim output As New MemoryBlock(0)\n  Dim lz As New LZMA.LZMAStream(output) ' zero-length creates a compressor\n  lz.Write(\"Hello, world!\")\n  lz.Close\n```\nThe string will be processed through the compressor and written to the `output` MemoryBlock. To create a decompressor pass a MemoryBlock whose size is \u003e 0 (continuing from above):\n\n```realbasic\n  lz = New LZMA.LZMAStream(output) ' output contains the compressed string\n  MsgBox(lz.Read(256)) ' read the decompressed string\n```\n\n### Encoder and Decoder classes\nThe other way to use LZMA is through the Encoder and Decoder classes found in the Codecs submodule. These classes provide a low-level wrapper to the LZMA API. All compression and decompression done using the `LZMAStream` class is ultimately carried out by an instance of an Encoder and Decoder class, respectively. You can construct instances directly, or use the [GetCompressor](https://github.com/charonn0/RB-liblzma/wiki/LZMA.GetCompressor) and [GetDecompressor](https://github.com/charonn0/RB-liblzma/wiki/LZMA.GetDecompressor) helper methods.\n\n```realbasic\n  ' compress\n  Dim encoder As New LZMA.Codecs.BasicEncoder(6, LZMA.ChecksumType.CRC32)\n  Dim src As MemoryBlock = \"Hello, world!\"\n  Dim inputstream As New BinaryStream(src)\n  Dim dst As New MemoryBlock(0)\n  Dim outputstream As New BinaryStream(dst)\n  \n  Do Until inputstream.EOF\n    Call encoder.Perform(inputstream, outputstream, LZMA.EncodeAction.Run, -1)\n  Loop\n  Call encoder.Perform(Nil, outputstream, LZMA.EncodeAction.Finish, -1)\n  inputstream.Close\n  outputstream.Close\n  \n  ' decompress\n  Dim decoder As New LZMA.Codecs.BasicDecoder(0, 0)\n  Dim result As New MemoryBlock(0)\n  inputstream = New BinaryStream(dst)\n  outputstream = New BinaryStream(result)\n  \n  Do Until inputstream.EOF\n    Call decoder.Perform(inputstream, outputstream, LZMA.EncodeAction.Run, -1)\n  Loop\n  \n  inputstream.Close\n  outputstream.Close\n  MsgBox(result)\n```\n\n## How to incorporate LZMA into your Realbasic/Xojo project\n### Import the `LZMA` module\n1. Download the RB-liblzma project either in [ZIP archive format](https://github.com/charonn0/RB-liblzma/archive/master.zip) or by cloning the repository with your Git client.\n2. Open the RB-liblzma project in REALstudio or Xojo. Open your project in a separate window.\n3. Copy the `LZMA` module into your project and save.\n\n### Ensure the LZMA shared library is installed\nLZMA is installed by default on some Unix-like operating systems, but may need to be installed separately.\n\nWindows does not have it installed by default, you will need to ship the DLL with your application. You can download pre-built binaries from the [XZ project page](https://tukaani.org/xz/), or you can build them yourself from source (ibid.)\n\nRB-liblzma will raise a PlatformNotSupportedException when used if all required DLLs/SOs/DyLibs are not available at runtime. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharonn0%2Frb-liblzma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharonn0%2Frb-liblzma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharonn0%2Frb-liblzma/lists"}