Updated the Unmarshal object to handle input streams