------------------------------------------------------------------------------
| 592 | |
| 593 | //------------------------------------------------------------------------------ |
| 594 | int vtkXMLDataParser::ReadBlock(vtkTypeUInt64 block, unsigned char* buffer) |
| 595 | { |
| 596 | size_t uncompressedSize = this->FindBlockSize(block); |
| 597 | size_t compressedSize = this->BlockCompressedSizes[block]; |
| 598 | |
| 599 | if (!this->DataStream->Seek(this->BlockStartOffsets[block])) |
| 600 | { |
| 601 | return 0; |
| 602 | } |
| 603 | |
| 604 | unsigned char* readBuffer = new unsigned char[compressedSize]; |
| 605 | |
| 606 | if (this->DataStream->Read(readBuffer, compressedSize) < compressedSize) |
| 607 | { |
| 608 | delete[] readBuffer; |
| 609 | return 0; |
| 610 | } |
| 611 | |
| 612 | size_t result = |
| 613 | this->Compressor->Uncompress(readBuffer, compressedSize, buffer, uncompressedSize); |
| 614 | |
| 615 | delete[] readBuffer; |
| 616 | return result > 0; |
| 617 | } |
| 618 | |
| 619 | //------------------------------------------------------------------------------ |
| 620 | unsigned char* vtkXMLDataParser::ReadBlock(vtkTypeUInt64 block) |
no test coverage detected