the problem with run-length encoding is that it only works on long pieces of the same value of data. if you receive a package with "abbaabaab" inside, that can be compressed into "1a2b2a1b2a1b"; but that's longer than the original! in this case, there's another method that can be used: checking how often a particular value comes up in the whole data package. this is often called frequency compression.