- added a method to read objects from streams