automatically determine type before reading integer tags