VTK Legacy file format readers don't handle sizeof(long) correctly
Currently the writer checks the
sizeof(long) and calls the correct byte-swap-to-big-endian function. But the reader assumes
sizeof(long) == sizeof(int) and calls the 4-byte byte-swap-from-big-endian function leading to garbage data. This can be reproduced with any dataset with a vtkLongArray on OSX (VTK writes a file it cannot read correctly) and possibly other platforms, but this is the only place I have seen it. Attached is a file written in the XML format (which seems unaffected by this) and contains a long array which can be used to reproduce this. I'm not sure what the right behavior is. It is either a) use the data type that can fit the data that was written or b) use the data type specified in the file so that assumptions about types are correct.