add ability to parse from a file object

Change-Id: I41292e8771838572fb1821ab3d68acdbc0a3ecf3