Looks to me like you could use ReadStruct here instead of reading the fields one by one. We're not JPCSP :)