I want to split data
to chunks of let's say 8154 byte:
data = Zlib::Deflate.deflate(some_very_long_string)
What would be the best way to do that?
I tried to use this:
chunks = data.scan /.{1,8154}/
...but data was lost! data
had a size
of 11682, but when looping through every chunk and summing up the size
I ended up with a total size of 11677. 5 bytes were lost! Why?
Thank you!