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

Method WriteCompressionHeader

IO/XML/vtkXMLWriter.cxx:1395–1423  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1393
1394//------------------------------------------------------------------------------
1395int vtkXMLWriter::WriteCompressionHeader()
1396{
1397 // Write real compression header back into stream.
1398 std::streampos returnPosition = this->Stream->tellp();
1399
1400 // Need to byte-swap header.
1401 this->PerformByteSwap(this->CompressionHeader->Data(), this->CompressionHeader->WordCount(),
1402 this->CompressionHeader->WordSize());
1403
1404 if (!this->Stream->seekp(std::streampos(this->CompressionHeaderPosition)))
1405 {
1406 return 0;
1407 }
1408 int result = (this->DataStream->StartWriting() &&
1409 this->DataStream->Write(this->CompressionHeader->Data(), this->CompressionHeader->DataSize()) &&
1410 this->DataStream->EndWriting());
1411 this->Stream->flush();
1412 if (this->Stream->fail())
1413 {
1414 this->SetErrorCode(vtkErrorCode::GetLastSystemError());
1415 return 0;
1416 }
1417
1418 if (!this->Stream->seekp(returnPosition))
1419 {
1420 return 0;
1421 }
1422 return result;
1423}
1424
1425//------------------------------------------------------------------------------
1426size_t vtkXMLWriter::GetOutputWordTypeSize(int dataType)

Callers 1

WriteBinaryDataMethod · 0.95

Calls 8

PerformByteSwapMethod · 0.95
WordCountMethod · 0.80
WordSizeMethod · 0.80
DataMethod · 0.45
StartWritingMethod · 0.45
WriteMethod · 0.45
EndWritingMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected