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

Function vtkReadBinaryData

IO/Legacy/vtkDataReader.cxx:1495–1513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1493// General templated function to read data of various types.
1494template <class T>
1495int vtkReadBinaryData(istream* IS, T* data, vtkIdType numTuples, vtkIdType numComp)
1496{
1497 if (numTuples == 0 || numComp == 0)
1498 {
1499 // nothing to read here.
1500 return 1;
1501 }
1502 char line[256];
1503
1504 // suck up newline
1505 IS->getline(line, 256);
1506 IS->read((char*)data, sizeof(T) * numComp * numTuples);
1507 if (IS->eof())
1508 {
1509 vtkGenericWarningMacro(<< "Error reading binary data!");
1510 return 0;
1511 }
1512 return 1;
1513}
1514
1515// General templated function to read data of various types.
1516template <class T>

Callers 1

ReadArrayMethod · 0.85

Calls 2

readMethod · 0.45
eofMethod · 0.45

Tested by

no test coverage detected