implement a binary export/import