Let's take the compressed output from the example in Appendix A, and decompress it. Remember, the compressed output from this example looked like:
A 00000000 00000101 00001000 01000010 00010000 10000100 00100001 l 00000000 00000100 00010001 00010001 00010001 00010001 a 00000000 00000011 00100100 10010010 01001001 n 00000000 00000010 01010101 01010101 ' ' 00000000 00000001 11111110
The non-encoded 'A' is read and placed in our decompressed output. Here's our decompressed output so far. Periods, '.', represent empty or unassigned spaces or characters. Note that we assume we know the size of the decompressed output before we decompress the input.
A...........................................
Next, the escape sequences follows,
, and then the length of the
encoded sequence measured in bytes is given,
, or five (5).
The five bytes that then follow specify additional occurrences of 'A' in our
decompressed output. We decode these, giving:
A....A....A....A....A....A....A....A....A...
Next, an 'l' occurs, and this is immediately added to the decompressed output:
Al...A....A....A....A....A....A....A....A...
After the 'l', the escape sequence occurs,
, followed by the
number of bytes in the encoded sequence,
, or four (4).
The four bytes that then follow specify additional occurrences of 'l' in
our decompressed output. We decode these, giving:
Al...Al...Al...Al...Al...Al...Al...Al...Al..
Next, an 'a' occurs, and this is immediately added to our decompressed output:
Ala..Al...Al...Al...Al...Al...Al...Al...Al..
The escape sequence,
, then follows the 'a', and after the escape
sequence, the number of bytes in the encoding is given,
, or
three (3). The three bytes that then follow specify additional occurrences of
'a' in the decompressed output. We decode these, giving:
Ala..Ala..Ala..Ala..Ala..Ala..Ala..Ala..Ala.
Next, an 'n' occurs, and this is immediately added to our decompressed output:
Alan.Ala..Ala..Ala..Ala..Ala..Ala..Ala..Ala.
The escape sequence,
, follows the 'n', and after the escape
sequence, the number of bytes in the encoding is given,
, or
two (2). The two bytes that then follow specify additional occurrences
of 'n' in the decompressed output. We decode these, giving:
Alan.Alan.Alan.Alan.Alan.Alan.Alan.Alan.Alan
Next, a space, or ' ', occurs, and this is immediately added to our decompressed output:
Alan Alan.Alan.Alan.Alan.Alan.Alan.Alan.Alan
The escape sequence,
, follows the space, and after the
escape sequence, the number of bytes in the encoding is given,
,
or one (1). The one byte that then follows specifies additional occurrences
of the space, or ' ', in the decompressed output. We decode these, giving:
Alan Alan Alan Alan Alan Alan Alan Alan Alan
We have decompressed the compressed output from Appendix A.