update bufAvailable for input buffer