Add common type and endian convert func.