Optimize Scanner.ReadChar() to return an int, where  -1 means no more characters similar to TextReader