add simple protection for infinit loop in StreamReader.read()
remove whitespace