BROTLI_OPERATION_FLUSH and BROTLI_OPERATION_PROCESS related #436

Closed
opened 2026-01-29 20:43:50 +00:00 by claunia · 1 comment
Owner

Originally created by @liwenzha on GitHub (Oct 20, 2022).

I want use the brotli compress with python, but I find in the BrotliCompress\brotli\python\ _brotli.cc, when the BrotliEncoderOperation is set to BROTLI_OPERATION_FLUSH, there is no input string as an argument.

BROTLI_OPERATION_PROCESS

static PyObject* brotli_Compressor_process(brotli_Compressor self, PyObject *args) {
PyObject
ret = NULL;
std::vector<uint8_t> output;
Py_buffer input;
BROTLI_BOOL ok = BROTLI_TRUE;

BROTLI_OPERATION_FLUSH

static PyObject* brotli_Compressor_flush(brotli_Compressor *self) {
PyObject *ret = NULL;
std::vector<uint8_t> output;
BROTLI_BOOL ok = BROTLI_TRUE;

I want to know what is the difference when BrotliEncoderOperation is set to BROTLI_OPERATION_FLUSH and BROTLI_OPERATION_PROCESS when compressing data?

Originally created by @liwenzha on GitHub (Oct 20, 2022). I want use the brotli compress with python, but I find in the **BrotliCompress\brotli\python\ _brotli.cc**, when the BrotliEncoderOperation is set to **BROTLI_OPERATION_FLUSH**, there is no input string as an argument. BROTLI_OPERATION_PROCESS > static PyObject* brotli_Compressor_process(brotli_Compressor *self, ***PyObject \*args***) { > PyObject* ret = NULL; > std::vector<uint8_t> output; > **Py_buffer input;** > BROTLI_BOOL ok = BROTLI_TRUE; BROTLI_OPERATION_FLUSH > static PyObject* brotli_Compressor_flush(brotli_Compressor *self) { > PyObject *ret = NULL; > std::vector<uint8_t> output; > BROTLI_BOOL ok = BROTLI_TRUE; I want to know what is the difference when BrotliEncoderOperation is set to BROTLI_OPERATION_FLUSH and BROTLI_OPERATION_PROCESS when compressing data?
Author
Owner

@eustas commented on GitHub (Dec 29, 2022):

"Flush" is used to force emitting compressed block. It is not certain how much data is produced to finish block -> "flush" request should be repeated until there is no more output produced. And that is why "flush" does not accept more input make the workflow states clear.

@eustas commented on GitHub (Dec 29, 2022): "Flush" is used to force emitting compressed block. It is not certain how much data is produced to finish block -> "flush" request should be repeated until there is no more output produced. And that is why "flush" does not accept more input make the workflow states clear.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#436