Do not use isDigit() and check if buffer is readable.