Code example for BufferedReader

Methods: close, readLine

0
        } catch (Exception e) {
            e.printStackTrace();
        } 
    } 
    private static String readLine(String filename) throws IOException {
        BufferedReader reader = new BufferedReader(new FileReader(filename), 256);
        try { 
            return reader.readLine();
        } finally { 
            reader.close();
        } 
    } 
 
    public static String getFormattedKernelVersion() {
        try { 
            return formatKernelVersion(readLine(FILENAME_PROC_VERSION));
 
        } catch (IOException e) {
            Log.e(LOG_TAG,
                "IO Exception when getting kernel version for Device Info screen", 
                e);