< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size
< size of input buffer
< start of input buffer
See Implementation