Binary Integrated Data Compression

I need to transmit integral data types over the network, but I donโ€™t want to transfer all 32 (or 64) bits all the time - the data fits in one byte 99% of the time - so it seems like I need to compress it somehow: for example, the first bit of the byte is 0, if the other 7 bits mean only a certain value (0-127), otherwise (if the first byte is 1), he needs to shift these 7 bytes to the left and read the second byte to do the same process.

Is there a general way to do this? I do not want to reinvent the wheel ...

Thank.

+3
source share
2 answers

, ( base-128: 7- "base-128" -, , ) .

, .

+3

. , .

0
source

All Articles