Run-length encoding/decoding class