add java solution for Endianness