Logo Search packages:      
Sourcecode: scummvm version File versions

MemoryReadStream * Common::ReadStream::readStream ( uint32  dataSize  )  [inherited]

Read the specified amount of data into a malloc'ed buffer which then is wrapped into a MemoryReadStream. The returned stream might contain less data than requested, if reading more failed, because of an I/O error or because the end of the stream was reached. Which can be determined by calling err() and eos().

Definition at line 36 of file stream.cpp.

References Common::ReadStream::read().

      void *buf = malloc(dataSize);
      dataSize = read(buf, dataSize);
      assert(dataSize > 0);
      return new MemoryReadStream((byte *)buf, dataSize, true);

Generated by  Doxygen 1.6.0   Back to index