Generalise data object reading and writing methods