------------------------------------------------------------------------------
| 1140 | |
| 1141 | //------------------------------------------------------------------------------ |
| 1142 | int vtkAVSucdReader::ReadFloatBlock(int n, float* block) |
| 1143 | { |
| 1144 | if (this->BinaryFile) |
| 1145 | { |
| 1146 | this->FileStream->read((char*)block, n * sizeof(float)); |
| 1147 | int retVal = static_cast<int>(this->FileStream->gcount()) / sizeof(int); |
| 1148 | if (this->ByteOrder == FILE_LITTLE_ENDIAN) |
| 1149 | { |
| 1150 | vtkByteSwap::Swap4LERange(block, n); |
| 1151 | } |
| 1152 | else |
| 1153 | { |
| 1154 | vtkByteSwap::Swap4BERange(block, n); |
| 1155 | } |
| 1156 | return retVal; |
| 1157 | } |
| 1158 | else |
| 1159 | { |
| 1160 | int count = 0; |
| 1161 | for (int i = 0; i < n; i++) |
| 1162 | { |
| 1163 | if (*(this->FileStream) >> block[i]) |
| 1164 | { |
| 1165 | count++; |
| 1166 | } |
| 1167 | else |
| 1168 | { |
| 1169 | return 0; |
| 1170 | } |
| 1171 | } |
| 1172 | return count; |
| 1173 | } |
| 1174 | } |
| 1175 | VTK_ABI_NAMESPACE_END |
no test coverage detected