Changed to return total input byte count consumed on each call