add functions for encoding/decoding arbitrary values inside gamma encoded streams