| 131 | } |
| 132 | |
| 133 | Result<FlushResult> Flush(int64_t output_len, uint8_t* output) override { |
| 134 | size_t avail_in = 0; |
| 135 | const uint8_t* next_in = nullptr; |
| 136 | auto avail_out = static_cast<size_t>(output_len); |
| 137 | BROTLI_BOOL ret; |
| 138 | |
| 139 | ret = BrotliEncoderCompressStream(state_, BROTLI_OPERATION_FLUSH, &avail_in, &next_in, |
| 140 | &avail_out, &output, nullptr /* total_out */); |
| 141 | if (!ret) { |
| 142 | return BrotliError("Brotli flush failed"); |
| 143 | } |
| 144 | return FlushResult{static_cast<int64_t>(output_len - avail_out), |
| 145 | !!BrotliEncoderHasMoreOutput(state_)}; |
| 146 | } |
| 147 | |
| 148 | Result<EndResult> End(int64_t output_len, uint8_t* output) override { |
| 149 | size_t avail_in = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected