开发者

Who can implement inflate in C# for dankogai's javascript deflate?

this is dankogai's javascript deflate http://github.com/dankogai/js-deflate I 开发者_开发百科can't inflate from c#,please help me


From the looks of it, it uses the standard GZip INFLATE/DEFLATE algorithms.

Just a question, why do you need to inflate it outside the browser?


I found a new one which johan fix something,the dankogai's version I can't inflate using java https://github.com/johan/js-deflate

If you want to inflate, you must fake zlib head and foot. Java code is like this:

    static public byte[] uncompress(byte[] input) throws DataFormatException {
    int len = input.length;
    byte[] out = new byte[len];
    byte[] src = new byte[len + 6];
    System.arraycopy(input, 0, src, 2, len);
    src[0] = (byte) (120);
    src[1] = (byte) (-100);

    Inflater inflater = new Inflater();
    inflater.setInput(src);

    inflater.finished();
    inflater.inflate(out);
    inflater.reset();

    return out;

}


I use Google's V8 Javascript engine ( http://javascriptdotnet.codeplex.com/ ) on server side to run Javascript code which I run on client side in web browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜