Passing a count parameter to the vector constructor does not reserve count elements but instead fills the vector with count elements. This caused the endianness check to fail first because the first 256 characters were null bytes.