Code example for FileReader

Methods: close, read

0
            File file = new File(LOG_FILE_PATH);
            if(!file.exists()) {
                file.createNewFile();
            } 
 
            reader = new FileReader(file);
            int length = (int)file.length();
            char[] temp = new char[length];
            reader.read(temp);
            result = new String(temp);
        } catch (Exception e) {
            //do nothing. 
        } finally { 
            if(reader != null) {
                try { 
                    reader.close();
                } catch (IOException e) {
                    //do nothing. 
                } 
            } 
        }