EOF detection for inputs