SMS LZW压缩 [英] SMS LZW Compression

查看:136
本文介绍了SMS LZW压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我.
如何使用LZW算法Java语言在SMS上压缩字符串消息,然后在接收方设备上将其解压缩为原始字符串.非常感谢.

如果可以使用任何算法.

非常感谢

Can anyone help me.
How to compress String message on SMS with LZW algoritm java language and then decompressing on receiver device to original string. Thanks so much.

If any algoritm is ok.

Thanks so much

推荐答案

采用此算法,希望对您有所帮助::)


LZW压缩算法:


take this algorithms and hope it helps u : :)


The LZW compression algorithm:


STRING = get input character
WHILE there are still input characters DO
    CHARACTER = get input character
    IF STRING+CHARACTER is in the string table then
        STRING = STRING+character
    ELSE
        output the code for STRING
        add STRING+CHARACTER to the string table
        STRING = CHARACTER
    END of IF
END of WHILE

output the code for STRING



这就是减压算法.



and this is the decompression algorithm.

Read OLD_CODE
output OLD_CODE
WHILE there are still input characters DO
    Read NEW_CODE
    STRING = get translation of NEW_CODE
    output STRING
    CHARACTER = first character in STRING
    add OLD_CODE + CHARACTER to the translation table
    OLD_CODE = NEW_CODE
END of WHILE





这是另一个参考资料





希望对您有帮助

最好的问候,
Basem Moghram





and this is another reference





Hope it helps you

Best Regards,
Basem Moghram


这篇关于SMS LZW压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆