Internal function to read an integer array. Returns zero if there was an error.
| 2798 | // Internal function to read an integer array. |
| 2799 | // Returns zero if there was an error. |
| 2800 | int vtkEnSight6BinaryReader::ReadIntArray(int* result, int numInts) |
| 2801 | { |
| 2802 | if (numInts <= 0) |
| 2803 | { |
| 2804 | return 1; |
| 2805 | } |
| 2806 | |
| 2807 | if (!this->BinaryIFile->read((char*)result, sizeof(int) * numInts)) |
| 2808 | { |
| 2809 | vtkErrorMacro("Read failed."); |
| 2810 | return 0; |
| 2811 | } |
| 2812 | if (this->ByteOrder == FILE_LITTLE_ENDIAN) |
| 2813 | { |
| 2814 | vtkByteSwap::Swap4LERange(result, numInts); |
| 2815 | } |
| 2816 | else |
| 2817 | { |
| 2818 | vtkByteSwap::Swap4BERange(result, numInts); |
| 2819 | } |
| 2820 | |
| 2821 | return 1; |
| 2822 | } |
| 2823 | |
| 2824 | // Internal function to read a float array. |
| 2825 | // Returns zero if there was an error. |
no test coverage detected