Code example for FileInputStream

Methods: close, read

0
            failStr(e.getMessage());
        }  
        int count = pFileOut.getBytes().length;
        byte[] buffer = new byte[count];
        try { 
            FileInputStream fis = new FileInputStream(pFile);
            fis.read(buffer, 0, count);
            fis.close();
        } catch (FileNotFoundException e) {
            failStr("Failed when verifing output opening file "+e.getMessage());
        } catch (IOException e) {
            failStr("Failed when verifying output, reading from written file "+e);
        } 
        String str = new String(buffer);
        assertEquals(str, pFileOut);
    }  
     
    /* 
     * This test case verifies that output written to a file 
     * using Context.openFileOutput has executed successfully. 
     * The operation is verified by invoking Context.openFileInput