Code example for Writer

Methods: write

    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));
        //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; 
Contextual code suggestions in your IDE  Get Codota for Java