MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / readAtMost

Method readAtMost

lib/InflateReader/InflateReader.cpp:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63InflateStatus InflateReader::readAtMost(uint8_t* dest, size_t maxLen, size_t* produced) {
64 if (!ringBuffer) {
65 // One-shot mode: back-references use absolute offset from dest_start.
66 // Valid only when readAtMost() is called once with the full output buffer.
67 decomp.dest_start = dest;
68 }
69 decomp.dest = dest;
70 decomp.dest_limit = dest + maxLen;
71
72 const int res = uzlib_uncompress(&decomp);
73 *produced = static_cast<size_t>(decomp.dest - dest);
74
75 if (res == TINF_DONE) return InflateStatus::Done;
76 if (res < 0) return InflateStatus::Error;
77 return InflateStatus::Ok;
78}

Callers 1

readFileToStreamMethod · 0.80

Calls 1

uzlib_uncompressFunction · 0.85

Tested by

no test coverage detected