MCPcopy Create free account
hub / github.com/apache/arrow / Flush

Method Flush

cpp/src/arrow/util/compression_bz2.cc:193–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 }
192
193 Result<FlushResult> Flush(int64_t output_len, uint8_t* output) override {
194 stream_.next_in = nullptr;
195 stream_.avail_in = 0;
196 stream_.next_out = reinterpret_cast<char*>(output);
197 stream_.avail_out = static_cast<unsigned int>(std::min(output_len, kSizeLimit));
198 int ret;
199
200 ret = BZ2_bzCompress(&stream_, BZ_FLUSH);
201 if (ret == BZ_RUN_OK || ret == BZ_FLUSH_OK) {
202 return FlushResult{output_len - stream_.avail_out, (ret == BZ_FLUSH_OK)};
203 } else {
204 return BZ2Error("bz2 compress failed: ", ret);
205 }
206 }
207
208 Result<EndResult> End(int64_t output_len, uint8_t* output) override {
209 stream_.next_in = nullptr;

Callers

nothing calls this directly

Calls 1

BZ2ErrorFunction · 0.85

Tested by

no test coverage detected