Implement big endian values with a template function.