read is not guaranteed to return a multiple of itemsize, one needs to loop in read until enough data is there and raise an error if not (e.g. due to file corruption)