| 194 | |
| 195 | template <typename ValueT> |
| 196 | vtkDenseArray<ValueT>* ReadDenseArrayBinary(istream& stream) |
| 197 | { |
| 198 | // Create the array ... |
| 199 | vtkSmartPointer<vtkDenseArray<ValueT>> array = vtkSmartPointer<vtkDenseArray<ValueT>>::New(); |
| 200 | |
| 201 | // Read the file header ... |
| 202 | vtkArrayExtents extents; |
| 203 | vtkArrayExtents::SizeT non_null_size = 0; |
| 204 | bool swap_endian = false; |
| 205 | ReadHeader(stream, extents, non_null_size, array); |
| 206 | ReadEndianOrderMark(stream, swap_endian); |
| 207 | |
| 208 | // Read array values ... |
| 209 | stream.read(reinterpret_cast<char*>(array->GetStorage()), non_null_size * sizeof(ValueT)); |
| 210 | |
| 211 | if (stream.eof()) |
| 212 | throw std::runtime_error("Premature end-of-file."); |
| 213 | if (stream.bad()) |
| 214 | throw std::runtime_error("Error while reading file."); |
| 215 | |
| 216 | array->Register(nullptr); |
| 217 | return array; |
| 218 | } |
| 219 | |
| 220 | template <> |
| 221 | vtkDenseArray<vtkStdString>* ReadDenseArrayBinary<vtkStdString>(istream& stream) |
nothing calls this directly
no test coverage detected