13.07.2015 Views

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tutorial on the System Classes...}input->read(inputBuffer, sizeof(char), length);inputBuffer[length] = '\0';// Add null-termination characterTo read or write to the stream, you must define:• a buffer to read from or write to• the size of each element• how many elements to read or write.The Filesystem methods are:• read() to read content from a file.• write() to write content to a file.• getLength() to get the length of the file• getPosition() to get the current position• setPosition() to manually set the position.4. Example 2-14 shows how to write the buffer to a file:Example 2-14 Writing to a file......output->write(inputBuffer, sizeof(char), length);output->flush();5. Example 2-15 shows deleting unused objects and the final catch block:Example 2-15 Deleting the buffer...delete [] inputBuffer;}catch(Exception& e){printf("An unexpected exception was thrown:\n%s\n", e.getMessage().getCharString() );}}The system and filesystem objects do not require manual deletion because the Managedtemplate tracks usage and automatically destroys the objects when the application exits.ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 2-10ID070710Non-Confidential - Draft - Beta

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!