JOHNZON-15 Daniel Cunha: handle the same way byte/short/int in both writePrimitives
extracting isInt/isFloat logic in functions