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

Method End

cpp/src/arrow/util/compression_brotli.cc:148–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147
148 Result<EndResult> End(int64_t output_len, uint8_t* output) override {
149 size_t avail_in = 0;
150 const uint8_t* next_in = nullptr;
151 auto avail_out = static_cast<size_t>(output_len);
152 BROTLI_BOOL ret;
153
154 ret =
155 BrotliEncoderCompressStream(state_, BROTLI_OPERATION_FINISH, &avail_in, &next_in,
156 &avail_out, &output, nullptr /* total_out */);
157 if (!ret) {
158 return BrotliError("Brotli end failed");
159 }
160 bool should_retry = !!BrotliEncoderHasMoreOutput(state_);
161 DCHECK_EQ(should_retry, !BrotliEncoderIsFinished(state_));
162 return EndResult{static_cast<int64_t>(output_len - avail_out), should_retry};
163 }
164
165 protected:
166 Status BrotliError(const char* msg) { return Status::IOError(msg); }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected