stream API fixes

zero size means 'read everything' and we should read the whole file only when size was either 0 or large enough to be more than file size