Swiss Army Knife for encoding and decoding binary streams