Using unrar library - extracting files into a filestream buffer

后端 未结 3 1923
陌清茗
陌清茗 2021-02-03 14:20

What I need is to be able to extract the files in a .rar file into streams. I\'m creating a test case to get a sense of how to use unrar source. I\'ve been searching and tinkeri

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-03 14:41

    I'm not familar with unrar, after quick reading of a documentation I think you are assuming that CallbackProc is called exactly once per file. However, I think unrar may call it multiple times. It unpacks some data then calls CallbackProc, then unpacks next data chunk and again calls CallbackProc, the process is iterated until all data is processed. You should remember how many bytes are actually written to buffer, and append new data at corresponding offset.

提交回复
热议问题