update buffer encoding/decoding in staged read for 32bit var ids and counts