Fix to-byte-array handling of Integer and Long

object to byte-array conversion did not work for Integer and Long, because I was using `putShort` method. Fixed that  here