有人可以帮我简单的算法吗?
我想解析http请求下载的所有字节如果它们> 100kb,如果不是,将它们连接到缓冲区,并且当缓冲区达到>时100kb 再次解析它们并将 uffer 清空。但不是解析所有文件数据并在最终块中获取 ex: 2kb。它必须检查下一个块,以及是否最终将其连接起来(例如:final_chunk.Length + 2kb),
重点是我每次都需要解析至少 100kb 块,不少于。
I want to parse all bytes downloaded by http request if they are > 100kb, if they are not, to concat them to a buffer and when the buffer gets > 100kb to parse them again and null the uffer. But not to parse all the file data and in the final chunk to get ex: 2kb. It must check the next chunk and if it's final to concat it (ex: final_chunk.Length + 2kb)
The point is that I need to parse at least 100kb chunks every time, nothing less.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如 PoweRoy 所说,你已经有了算法,你只需要编码它......让我一步一步地讲。
As PoweRoy Said you already got algorithm you just need code it... Let me put it step by step.
我想这样就可以了。我只需要用字节数组重写它。你发现任何错误吗?
I guess that will do the trick. I just have to rewrite it with byte arrays. Do you find any bugs?
这是字节数组列表:
And here it is with list of byte arrays: