Module osm.io.pbf.decompress
Bounded materialization of validated OSMPBF Blob payloads.
Raw Blob payloads are returned zero-copy. Zlib payloads are decompressed into
caller-owned storage whose capacity is validated before calling zlib. The
zlib path uses uncompress2, allowing osm-d to enforce the declared
raw_size as a hard output bound and to reject trailing compressed bytes.
No GC allocation occurs in this module; streaming workers can therefore use
pooled per-worker buffers.
LZMA, LZ4, and Zstandard fields are recognized by the Blob decoder but do not yet have built-in backends. The deprecated bzip2 field receives a distinct error so callers never confuse it with a future optional codec.
Date
2026-09-12
Functions
| Name | Description |
|---|---|
decodeBlobPayloadInto(blob, outputBuffer, payload, status)
|
Produce validated uncompressed payload bytes from a decoded Blob. |
requiredOutputSize(blob)
|
Return the caller-output capacity needed by decodeBlobPayloadInto.
|
Structs
| Name | Description |
|---|---|
BlobPayloadView
|
Borrowed view of validated uncompressed Blob payload bytes. |
Enums
| Name | Description |
|---|---|
BlobPayloadStorage
|
Ownership/lifetime source of bytes returned by decodeBlobPayloadInto.
|