Code example for RandomAccessFile

Methods: closereadLine

0
 
    RandomAccessFile reader = null;
    String load = null;
 
    try { 
      reader = new RandomAccessFile("/proc/stat", "r");
      load = reader.readLine();
    } catch (IOException ex) {
      Log.e("LinuxUtils", "Failed to read /proc/stat", ex);
    } finally { 
      try { 
        reader.close();
      } catch (IOException e) {
        Log.e("LinuxUtils", "Failed to close stream");
      } 
    } 
 
    return load;
  } 
 
  /**