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

Function ReadDenseArrayBinary

IO/Core/vtkArrayReader.cxx:196–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195template <typename ValueT>
196vtkDenseArray<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
220template <>
221vtkDenseArray<vtkStdString>* ReadDenseArrayBinary<vtkStdString>(istream& stream)

Callers

nothing calls this directly

Calls 6

ReadHeaderFunction · 0.85
ReadEndianOrderMarkFunction · 0.85
NewFunction · 0.50
readMethod · 0.45
eofMethod · 0.45
RegisterMethod · 0.45

Tested by

no test coverage detected