Snappy (software) - Example of A Compressed Stream

Example of A Compressed Stream

Wikipedia is a free, web-based, collaborative, multilingual encyclopedia project.

is compressed to:

0000000: ca02 f042 5769 6b69 7065 6469 6120 6973 ...BWikipedia is

Length of data is 0x02ca(varint) = 0x014a = 330 bytes; 0xf042 = literal of 66+1 bytes follows

0000010: 2061 2066 7265 652c 2077 6562 2d62 6173 a free, web-bas 0000020: 6564 2c20 636f 6c6c 6162 6f72 6174 6976 ed, collaborativ 0000030: 652c 206d 756c 7469 6c69 6e67 7561 6c20 e, multilingual 0000040: 656e 6379 636c 6f09 3ff0 8170 726f 6a65 encyclo.?..proje

0x09 is tag-byte of type 01 with length of 0b10= 2 +4 = 6 and offset = 0x03f = 63 or "pedia ";
0xf081 is a literal with length of 129+1 bytes

0000050: 6374 2e00 0000 0000 0000 0000 0000 0000 ct.

In this example all common substrings with four or more characters were eliminated by the compression process. More common compressors can compress this better. Unlike compression methods such as gzip and bzip2, there is no entropy encoding used to pack alphabet into the bit stream.

Read more about this topic:  Snappy (software)

Famous quotes containing the words compressed and/or stream:

    The human mind is so complex and things are so tangled up with each other that, to explain a blade of straw, one would have to take to pieces an entire universe.... A definition is a sack of flour compressed into a thimble.
    Rémy De Gourmont (1858–1915)

    To me heaven would be a big bull ring with me holding two barrera seats and a trout stream outside that no one else was allowed to fish in and two lovely houses in the town; one where I would have my wife and children and be monogamous and love them truly and well and the other where I would have my nine beautiful mistresses on nine different floors.
    Ernest Hemingway (1899–1961)