http://w3schools.com/ajax/ajax_intro.asp
Is reversing the vector an option? I guess this should work:
reverse(foo.begin(), foo.end()); long some_long = *(long *)&foo[0];