Hello.. I'm really struggling here.
I am currently using the Rosetta Code implementation for LZW decompression (C++). This implementation requires numerical imput. That is.. the input in it's compressed state is in numerical form.. a series of numbers. My problem is this:
I want to read the compressed LZW stream (compressed only in LZW and not encoded in ASCII 85) into a buffer and that is then passed to the decompression algorithm for decompression. I open the pdf in binary mode, read each character and convert it to an int and load each integer into the buffer . Once the buffer (which is an int vector) is loaded, I pass this to the algorithm for decompression.
Unfortunately the data will not decompress. I seem to get the same output as I put into it in a character form. I have included white space (noskipws) and also tried the opposite. I have also tried (using bitwise shift operation) to create 12 bit chunks and then loading those into an int vector. This isn't working either. I'm thinking it has something to do with how I am reading the data in the first place. What do all these little glyphs represent (in the compressed stream)? How do I go about reading compressed data into a buffer if the algorithm I am using requires numberical input common to LZW compression?
Should I include white space? How should I read the compressed data?
Any clues would be greatly appreciated.
Thanks very much.