Search code examples
c++visual-studio-2010qtmemory-mapped-files

Streaming from memory mapped files in Qt


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!


Solution

  • 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.