Pack/unpack binary structures