Streaming from memory mapped files in Qt

拟墨画扇 提交于 2019-12-11 10:08:34

问题


Is there any way to create a data stream that is located at the beginning of a memory mapped file in Qt? Once i use QFile::map method, i get a uchar*. So is there any way to initialize a data stream with it? Thanks in advance!


回答1:


I've not tried it but there's a QDataStream::readRawData() function that accepts a char * and a length which you should be able to pipe that uchar * into. That'll give you your stream.



来源:https://stackoverflow.com/questions/12065879/streaming-from-memory-mapped-files-in-qt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!