This page provides definitions for codebase-specific terminology, abbreviations, and domain concepts used throughout the GrindCore.net library. It serves as a technical reference for onboarding engineers to understand how abstract compression concepts map to the internal implementation.
A "one-shot" compression pattern where an entire discrete buffer is processed at once, rather than through a continuous stream. This is typically used for small messages or database records where the overhead of a stream state is undesirable.
CompressionBlock abstract class.CompressionBlockFactory provides a straightforward mechanism for initializing block-based compression instances [README.md:62-66].A sequential compression pattern following the standard System.IO.Stream pattern. It allows for processing data of unknown or very large lengths by maintaining internal state across multiple Read or Write calls.
CompressionStream base class [README.md:61-61].CompressionStreamFactory allows easy instantiation of stream-based compression classes [README.md:65-65].GrindCore tracks two distinct positions on every stream to assist with progress monitoring and framing.
Advanced buffer management for precise stream rewinding when "overreads" occur. When a decompressor reads more data from the base stream than is required to satisfy a specific request, the system manages the buffer to ensure subsequent consumers see the correct stream offset [README.md:48-48].
A compression mode where the dictionary is preserved across the entire stream instead of being reset at block boundaries. In GrindCore, this is typically used to match 7-Zip settings.
CompressionOptions.BlockSize to -1 [src/CompressionOptions.cs:34-38].WithLzma2Dictionary sets BlockSize to -1 by default to enable this behavior [src/CompressionOptions.cs:144-147].The following diagram illustrates how natural language compression requests are translated into specific code entities and data structures within the GrindCore architecture.
Sources: [src/CompressionOptions.cs:11-66], [src/Fast-Lzma2/FastLzma2Encoder.cs:26-83], [README.md:64-67]
| Term | Definition | Code Reference |
|---|---|---|
| CancellableTask | A wrapper used to provide cooperative cancellation for both synchronous and asynchronous operations. | [src/Fast-Lzma2/FastLzma2Encoder.cs:126-126] |
| CompressionType | Enum defining the goal: Decompress, Fastest, Optimal, SmallestSize, or specific numeric levels (0-22). | [src/CompressionOptions.cs:16-16] |
| InitProperties | Algorithm-specific metadata (like LZMA's lc, lp, pb) required to initialize a decoder. | [src/CompressionOptions.cs:53-55] |
| LeaveOpen | A boolean flag that prevents the BaseStream from being closed when the CompressionStream is disposed. | [src/CompressionOptions.cs:21-21] |
| Ng (Next Gen) | Refers to implementations using modern forks like zlib-ng (v2.2.1), which offer SIMD optimizations over classic zlib. | [src/GrindCore.net.csproj:81-81] |
| RID (Runtime ID) | Identifier for platform-specific native assets (e.g., win-x64, linux-arm64, osx-arm64). | [src/GrindCore.net.csproj:13-13] |
| WriteEndMark | An option for LZMA/LZMA2 to force or suppress the End-of-Payload Marker (EOPM). | [tests/GrindCore.Tests/LzmaWriteEndMarkTests.cs:12-19] |
The diagram below shows the relationship between the managed API surface and the underlying native interop layer for the Brotli algorithm as an example.
Sources: [src/GrindCore.net.csproj:59-103], [src/Brotli/BrotliEncoder.cs:11-45], [src/Brotli/BrotliDecoder.cs:11-33]
net20 to net10.0 [src/GrindCore.net.csproj:6-6].Sources: [README.md:48-52], [src/GrindCore.net.csproj:1-104], [src/CompressionOptions.cs:11-66], [src/Fast-Lzma2/FastLzma2Encoder.cs:5-83], [src/Brotli/BrotliEncoder.cs:8-45], [tests/GrindCore.Tests/LzmaWriteEndMarkTests.cs:10-20]
Refresh this wiki