InputStream reading fixed

In my tests I found that the previous implementation of `scan(InputStream in)` didn't read the given InputStream to the end. I'd like to suggest this implementation instead.