Added check for endianess

Signed-off-by: rpgmaker <olamide.bakre@gmail.com>