Just for simplicity: Let's assume that I have a file of 1073741825 bytes = 1GiB+1B. And I want to put it inside my exactly 1073741824 bytes = 1GiB pendrive. (Just assume that the OS filesystem doesn't waste any space.)
Are you sure that this algorithm will compress my 1073741825 bytes file to a 1073741824 bytes or less file?