O'Reilly logo

Mastering Android NDK by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mount points and streams

On Android, the test.txt file is most likely to reside in the .apk package and a lot of work needs to happen within the CreateReader() call. The data for test.txt is extracted and an instance of clMemFileMapper is created. Let's travel down the hidden pipeline of file operations.

The code for CreateReader() is simple. First, we convert the slashes and backslashes in the path to match those of the underlying operating system. Then a mount point is found which hosts the file named FileName. Finally, an instance of clFileMapper is created. This class implements the iIStream interface. Let's take a closer look at all these classes:

clPtr<iIStream> clFileSystem::CreateReader( const std::string& FileName ) const { std::string ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required