Use Scanner to read from a stream, maybe fixing the content-length problem