Modified the reader to use try with resource

Change-Id: I2e5f030f777fd3518150722177bb2b2f2c3dbb27