{"action":"opened","issue":{"url":"https://api.github.com/repos/luapower/zlib/issues/1","repository_url":"https://api.github.com/repos/luapower/zlib","labels_url":"https://api.github.com/repos/luapower/zlib/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/luapower/zlib/issues/1/comments","events_url":"https://api.github.com/repos/luapower/zlib/issues/1/events","html_url":"https://github.com/luapower/zlib/issues/1","id":151729127,"number":1,"title":"How to use this library on an incoming http stream","user":{"login":"alubbe","id":2028065,"avatar_url":"https://avatars.githubusercontent.com/u/2028065?v=3","gravatar_id":"","url":"https://api.github.com/users/alubbe","html_url":"https://github.com/alubbe","followers_url":"https://api.github.com/users/alubbe/followers","following_url":"https://api.github.com/users/alubbe/following{/other_user}","gists_url":"https://api.github.com/users/alubbe/gists{/gist_id}","starred_url":"https://api.github.com/users/alubbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alubbe/subscriptions","organizations_url":"https://api.github.com/users/alubbe/orgs","repos_url":"https://api.github.com/users/alubbe/repos","events_url":"https://api.github.com/users/alubbe/events{/privacy}","received_events_url":"https://api.github.com/users/alubbe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-28T19:56:38Z","updated_at":"2016-04-28T19:56:38Z","closed_at":null,"body":"I'm currently using https://github.com/brimworks/lua-zlib but would like to try & benchmark your library because it uses luajit's ffi. What I'd like to do is instantiate an inflate once and then pass it chunks as they come in. This my implementation building on lua-zlib:\r\n```lua\r\nlocal zlib = require \"zlib\"\r\nlocal function onNewResponse()\r\n  local inflate = zlib.inflate()\r\n  local function onReceive(chunk) -- this function gets called whenever a new tcp chunk is received\r\n    chunk = inflate(chunk)\r\n    ...\r\n  end\r\nend\r\n```\r\nCould you help me figure out what the equivalent code would be? I've not been able to \"resume\" inflation with your API because I cannot call \"next\" on the tcp chunk reader, rather it calls the inflate."}}