------------------------------------------------------------------------------
| 844 | |
| 845 | //------------------------------------------------------------------------------ |
| 846 | size_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 | //------------------------------------------------------------------------------ |
| 887 | size_t vtkXMLDataParser::ReadAsciiData( |
no test coverage detected