Just like Python's struct module, pack/unpack values to/from buffer.