4.2.1.1.3 Example 3
Uncompressed input:
The pattern "ABC" is repeated 20 times.
-
41 42 43 41 42 43 41 42 43 41 42 43 41 42 43 41 ABCABCABCABCABCA 42 43 41 42 43 41 42 43 41 42 43 41 42 43 41 42 BCABCABCABCABCAB 43 41 42 43 41 42 43 41 42 43 41 42 43 41 42 43 CABCABCABCABCABC 41 42 43 41 42 43 41 42 43 41 42 43 ABCABCABCABC
Compressed output:
The first byte is SINGLE, so the other fields of the RDP_SEGMENTED_DATA (section 2.2.5.1) structure are omitted. The second begins the compressed segment. The first byte of that segment includes PACKET_COMPRESSED, so the remainder is encoded. The final byte 0x01 indicates that only one bit is unused, so the encoded data is 47 bits in length. Note that an overlapping match intentionally causes replication.
-
E0 24 20 90 88 71 1F B2 01 E0 = DEBLOCK_SINGLE 24 = PACKET_COMPRESSED + type 4 20 = binary 0 0100000 90 = binary 1 0 010000 88 = binary 10 0 01000 71 = binary 011 10001 1F = binary 00011 111 B2 = binary 10 11001 (0) 01 = one bit (least-significant) ignored from 0xB2 byte.
Decoded binary stream:
-
0 01000001 = literal 65 = "A" 0 01000010 = literal 66 = "B" 0 01000011 = literal 67 = "C" 10001 00011 = match distance = 3 11110 11001 = match length = 32 + 25 = 57 (0) ignored