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

Method ReadBinaryData

IO/XMLParser/vtkXMLDataParser.cxx:846–884  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

844
845//------------------------------------------------------------------------------
846size_t vtkXMLDataParser::ReadBinaryData(
847 void* in_buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
848{
849 // Skip real read if aborting.
850 if (this->Abort)
851 {
852 return 0;
853 }
854
855 size_t wordSize = this->GetWordTypeSize(wordType);
856 void* buffer = in_buffer;
857
858 // Make sure our streams are setup correctly.
859 this->DataStream->SetStream(this->Stream);
860
861 // Read the data.
862 unsigned char* d = reinterpret_cast<unsigned char*>(buffer);
863 size_t actualWords;
864 if (this->Compressor)
865 {
866 if (!this->ReadCompressionHeader())
867 {
868 vtkErrorMacro("ReadCompressionHeader failed. Aborting read.");
869 return 0;
870 }
871 this->DataStream->StartReading();
872 actualWords = this->ReadCompressedData(d, startWord, numWords, wordSize);
873 this->DataStream->EndReading();
874 }
875 else
876 {
877 this->DataStream->StartReading();
878 actualWords = this->ReadUncompressedData(d, startWord, numWords, wordSize);
879 this->DataStream->EndReading();
880 }
881
882 // Return the actual amount read.
883 return this->Abort ? 0 : actualWords;
884}
885
886//------------------------------------------------------------------------------
887size_t vtkXMLDataParser::ReadAsciiData(

Callers 2

ReadInlineDataMethod · 0.95
ReadAppendedDataMethod · 0.95

Calls 7

GetWordTypeSizeMethod · 0.95
ReadCompressionHeaderMethod · 0.95
ReadCompressedDataMethod · 0.95
ReadUncompressedDataMethod · 0.95
SetStreamMethod · 0.45
StartReadingMethod · 0.45
EndReadingMethod · 0.45

Tested by

no test coverage detected