Code example for Writer

Methods: write

0
 
    public boolean validateMemoryResult (int startPid, int startMemory, Writer output) throws Exception {
        mEndPid = getMediaserverPid();
        mEndMemory = getMediaserverVsize();
        Log.v(TAG, "End Memory " + mEndMemory);
        output.write("End Memory :" + mEndMemory + "\n");
        //Write the total memory different into the output file 
        output.write("The total diff = " + (mEndMemory - startMemory));
        output.write("\n\n");
        //mediaserver crash 
        if (startPid != mEndPid){
            output.write("mediaserver died. Test failed\n");
            return false; 
        } 
        //memory leak greter than the tolerant 
        if ((mEndMemory - startMemory) > MAX_ACCEPTED_MEMORY_LEAK_KB )
            return false; 
        return true; 
    } 
 
    @Suppress