FileInputStream fin = null; BufferedReader br = null;try { fin = new FileInputStream("somefile.txt"); fin.skip(fileLength - 100); br = new BufferedReader(fin); //TODO do what you want to do } catch (IOException e) { } finally { if (br != null) try {br.close(); }catch(Exception e) {} if (fin != null) try {fin.close(); }catch(Exception e) {} }
BufferedReader br = null;try {
fin = new FileInputStream("somefile.txt");
fin.skip(fileLength - 100);
br = new BufferedReader(fin);
//TODO do what you want to do
} catch (IOException e) {
} finally {
if (br != null) try {br.close(); }catch(Exception e) {}
if (fin != null) try {fin.close(); }catch(Exception e) {}
}