My app has a custom Document type and create, edit, and save the Documents with custom extension. For saving I serialize the document and write Data to a file
Data