saveObject function

Saves an object to a file or a connection