go - Golang: can't decompress data with lzw package -


I am trying to create a compressed string pool with go. This is my code -

I can not put pressure on what is compressed with the compressed / LJW package. Input for Lzw.Writer [104 101 108 108 111 32 119 111 114 108 100] and production of lzw.Reader [0 0 3 3 3 2 0 0]. They definitely do not match.

I am making the reader and author with the same parameters (all except buffer). The buffer for the Lzw.Reader contains data, which was previously compressed with lzw.Writer.

your litWidth lzw.NewReader and < parameter 2 to 8 for code> lzw.NewWriter

I do not know much about LZW, but it seems that how many bits are considered by by litwidth , so the value of 2 is that all input bytes Must be 0x00 - 0x03

See the minimum example of a LZW round-trip, a litWidth of 7 tasks (but probably not safe for UTF-8 lessons), anything less than 7 fails .

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -