started swapping endianness of read header if littleendian