------------------------------------------------------------------------------
| 616 | |
| 617 | //------------------------------------------------------------------------------ |
| 618 | bool EnSightFile::DetectByteOrder(int* result) |
| 619 | { |
| 620 | if (this->ByteOrder == Endianness::Unknown) |
| 621 | { |
| 622 | int tmpLE = *result; |
| 623 | int tmpBE = *result; |
| 624 | vtkByteSwap::Swap4LE(&tmpLE); |
| 625 | vtkByteSwap::Swap4BE(&tmpBE); |
| 626 | |
| 627 | if (tmpLE >= 0 && tmpLE < MAXIMUM_PART_ID) |
| 628 | { |
| 629 | this->ByteOrder = Endianness::Little; |
| 630 | *result = tmpLE; |
| 631 | return true; |
| 632 | } |
| 633 | if (tmpBE >= 0 && tmpBE < MAXIMUM_PART_ID) |
| 634 | { |
| 635 | this->ByteOrder = Endianness::Big; |
| 636 | *result = tmpBE; |
| 637 | return true; |
| 638 | } |
| 639 | vtkGenericWarningMacro("Byte order could not be determined."); |
| 640 | return false; |
| 641 | } |
| 642 | return true; |
| 643 | } |
| 644 | |
| 645 | //------------------------------------------------------------------------------ |
| 646 | void EnSightFile::MoveReadPosition(vtkTypeInt64 numBytes) |