checking for end of input stream to avoid IOException
adding a line for formatting
Merge pull request #7 from nallagsoc/master

Checking for end of input stream to prevent IOException