MCPcopy Create free account
hub / github.com/Kitware/VTK / ReadIntArray

Method ReadIntArray

IO/EnSight/vtkEnSight6BinaryReader.cxx:2800–2822  ·  view source on GitHub ↗

Internal function to read an integer array. Returns zero if there was an error.

Source from the content-addressed store, hash-verified

2798// Internal function to read an integer array.
2799// Returns zero if there was an error.
2800int 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.

Callers 4

ReadGeometryFileMethod · 0.95

Calls 1

readMethod · 0.45

Tested by

no test coverage detected