My problem: I want to save an array of bytes in a compressed file, and then I want to read it with good performance.
So, I create an array of bytes, then move on to the ZLIB algorithm, and then save it in a file. To my surprise, the algorithm does not work very well. Probably because the array is a random pattern. Using this approach, it will be easy to read. Just copy the stream to memory, unzip them and copy them to an array of bytes.
But I need to compress the file. Should I use an algorithm like RLE to compress an array of bytes? I think I can store an array of bytes as a string, and then compress it. But I think that I will have poor performance when reading data.
Sorry for my bad english.
thank
source
share