Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Apple Data Compression (ADC) data format

ADC compression is used in various data formats used on Mac OS, including Universal Disk Image Format (UDIF) files (.dmg).

Overview

ADC compressed data consist of:

Characteristics

CharacteristicsDescription
Byte orderbig-endian

ADC chunk

An ADC chunk is of variable size and consists of consists of:

OffsetSizeValueDescription
0.01 bitLiteral chunk flag
If literal chunk flag is set (1)
0.17 bitsLiteral data size, in number of bytes, where size = value + 1
1.0...Literal (uncompressed) data
If literal chunk flag is not set (0)
0.11 bitExtended-size chunk flags
If extended-size chunk flag is not set (0)
0.24 bitsCompressed data size, in number of bytes, where size = value + 3
0.610 bitsCompressed data distance, where 0 is the offset of the last previously uncompressed byte
If extended-size chunk flag is set (1)
0.26 bitsCompressed data size, in number of bytes, where size = value + 4
1.016 bitsCompressed data distance, where 0 is the offset of the last previously uncompressed byte