added interface to pack messages into binary