问题
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