There fixed buffer of data to be sent, let's say 300 bytes
The buffer can be filled with entries of varying sizes until the buffer is full. Only complete entries should be contained in the buffer. An entry is between 30 and 60 bytes in length.
Now the idea is to compress this buffer. But here I seem to run into the issue that the poll does not actually append data every time, so I have no way of knowing if the entry I compress actually fits in the buffer.
So, we have this use case:
Now the idea is to compress this buffer. But here I seem to run into the issue that the poll does not actually append data every time, so I have no way of knowing if the entry I compress actually fits in the buffer.
Is there a simple way to solve this?