# LZIS · block stream

Block-compression wrapper with a physical index. Its decoded contents must be identified separately.

**Documented edition: Imperivm HD · Partial documentation**

## The wrapper does not define the contents

LZIS can occur in saved games, profiles, replays and content packs. Its signature describes the block stream rather than the final document type.

Identify the contents again after decoding. For example, the RandomMapSettlements.bfhp settlement library contains an HPFS volume. Do not automatically treat an LZIS file as a map or ZIP archive.

## Header and index

The number of stored offsets is n = max(1, ceil(logical size / block size)). No additional final offset is stored: the last block ends at the physical stream length.

| Byte position | Size | Contents |
| --- | --- | --- |
| 0 | 4 bytes | ASCII signature LZIS |
| 4 | 4 bytes | Decoded logical size |
| 8 | 4 bytes | Logical block size |
| 12 | 1 byte | Mode |
| 13 | 1 byte | Byte without a completely documented meaning |
| 14 | 4 × n bytes | Physical position of each block |

## Interpreting blocks

A physical span shorter than its block's logical length is interpreted as compressed. If it reaches that length without exceeding the block size, it contains raw bytes. A span exceeding the block size does not satisfy that reading rule.

Compression uses canonical prefix codes and references to earlier data. Similarity between some tables and Deflate does not make the stream a standard zlib or Deflate file.

## Known limits

Decoded-file coverage is for mode 2. Other modes and compatible writing or recompression are not documented as complete workflows in this entry.

Do not infer contents from the extension alone or assume one block size across all uses. This entry summarizes the container and its reading rules; it does not include a codec implementation.

## Read and share

- [Markdown](/imperivm/exports/en/formatos/lzis.md)
- [JSON](/imperivm/exports/en/formatos/lzis.json)

## Related pages

- [BFHP / HPFS · map containers](/imperivm/en/formatos/bfhp/)
- [PAK · resource packages](/imperivm/en/formatos/pak/)
