for pull request 9 -- calculate the correct number of bytes to clear frm the count
split out into proper serialize/deserialize methods for int/uint variants