closing stream properly
closing stream properly - using 1.6 constructs since travis didn't like building this on OpenJDK 1.7
Merge pull request #3 from ayush/master

Merging with the the Ayush's code to close the stream properly.

Thank you Ayush.