|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.io.input.ReversedLinesFileReader
public class ReversedLinesFileReader
Reads lines in a file reversely (similar to a BufferedReader, but starting at the last line). Useful for e.g. searching in log files.
Constructor Summary | |
---|---|
ReversedLinesFileReader(File file)
Creates a ReversedLinesFileReader with default block size of 4KB and the platform's default encoding. |
|
ReversedLinesFileReader(File file,
int blockSize,
String encoding)
Creates a ReversedLinesFileReader with the given block size and encoding. |
Method Summary | |
---|---|
void |
close()
Closes underlying resources. |
String |
readLine()
Returns the lines of the file from bottom to top. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReversedLinesFileReader(File file) throws IOException
file
- the file to be read
IOException
- if an I/O error occurspublic ReversedLinesFileReader(File file, int blockSize, String encoding) throws IOException
file
- the file to be readblockSize
- size of the internal buffer (for ideal performance this should
match with the block size of the underlying file system).encoding
- the encoding of the file
IOException
- if an I/O error occursMethod Detail |
---|
public String readLine() throws IOException
IOException
- if an I/O error occurspublic void close() throws IOException
close
in interface Closeable
IOException
- if an I/O error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |