[Quote=引用 5 楼 fire_woods 的回复:]
Loop until you get the number of unpacked bytes you are
expecting:
Read the next source byte into n.
If n is between 0 and 127 inclusive, copy the next n+1 bytes
literally.
Else if n is between -127 and -1 inclusive, copy the next
byte -n+1 times.
Else if n is 128, noop.
Endloop
从解码的算法来看,编码应该是把所有一样的内容放在一起,最多127个,用负数来…
[/Quote]
Loop until you get the number of unpacked bytes you are
expecting:
Read the next source byte into n.
If n is between 0 and 127 inclusive, copy the next n+1 bytes
literally.
Else if n is between -127 and -1 inclusive, copy the next
byte -n+1 times.
Else if n is 128, noop.
Endloop
从解码的算法来看,编码应该是把所有一样的内容放在一起,最多127个,用负数来记录,
不一样的内容放在一起,最多127个,用正数记录.