org.nuiton.util
Class ReverseFileReader

java.lang.Object
  extended by org.nuiton.util.ReverseFileReader
All Implemented Interfaces:
Closeable

public class ReverseFileReader
extends Object
implements Closeable

Reverse file reader.

Version:
$ID: $ TODO add an interface on it.
Author:
chatellier

Field Summary
protected  String filename
           
protected  long position
           
protected  RandomAccessFile randomfile
           
 
Constructor Summary
ReverseFileReader(File file)
           
ReverseFileReader(String filename)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 String readLine()
          Read one line from the current position towards the beginning.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

protected String filename

randomfile

protected RandomAccessFile randomfile

position

protected long position
Constructor Detail

ReverseFileReader

public ReverseFileReader(File file)
                  throws IOException
Throws:
IOException

ReverseFileReader

public ReverseFileReader(String filename)
                  throws IOException
Throws:
IOException
Method Detail

readLine

public String readLine()
                throws IOException
Read one line from the current position towards the beginning.

Returns:
the next line of text from this file, or null if end of file is encountered before even one byte is read.
Throws:
IOException - if any pb while reading line

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2004-2011 CodeLutin. All Rights Reserved.