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

Method WriteCompressionBlock

IO/XML/vtkXMLWriter.cxx:1369–1392  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1367
1368//------------------------------------------------------------------------------
1369int vtkXMLWriter::WriteCompressionBlock(unsigned char* data, size_t size)
1370{
1371 // Compress the data.
1372 vtkUnsignedCharArray* outputArray = this->Compressor->Compress(data, size);
1373
1374 // Find the compressed size.
1375 size_t outputSize = outputArray->GetNumberOfTuples();
1376 unsigned char* outputPointer = outputArray->GetPointer(0);
1377
1378 // Write the compressed data.
1379 int result = this->DataStream->Write(outputPointer, outputSize);
1380 this->Stream->flush();
1381 if (this->Stream->fail())
1382 {
1383 this->SetErrorCode(vtkErrorCode::GetLastSystemError());
1384 }
1385
1386 // Store the resulting compressed size in the compression header.
1387 this->CompressionHeader->Set(3 + this->CompressionBlockNumber++, outputSize);
1388
1389 outputArray->Delete();
1390
1391 return result;
1392}
1393
1394//------------------------------------------------------------------------------
1395int vtkXMLWriter::WriteCompressionHeader()

Callers 1

WriteBinaryDataBlockMethod · 0.95

Calls 7

DeleteMethod · 0.65
CompressMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetPointerMethod · 0.45
WriteMethod · 0.45
flushMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected