public class ReversedLinesFileReader extends Object implements Closeable
| Constructor and Description |
|---|
ReversedLinesFileReader(File file)
Creates a ReversedLinesFileReader with default block size of 4KB and the
platform's default encoding.
|
ReversedLinesFileReader(File file,
int blockSize,
Charset encoding)
Creates a ReversedLinesFileReader with the given block size and encoding.
|
ReversedLinesFileReader(File file,
int blockSize,
String encoding)
Creates a ReversedLinesFileReader with the given block size and encoding.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes underlying resources.
|
String |
readLine()
Returns the lines of the file from bottom to top.
|
public ReversedLinesFileReader(File file) throws IOException
file - the file to be readIOException - if an I/O error occurspublic ReversedLinesFileReader(File file, int blockSize, Charset 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 fileIOException - 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 fileIOException - if an I/O error occursUnsupportedCharsetException - thrown instead of UnsupportedEncodingException in version 2.2 if the encoding is not
supported.public String readLine() throws IOException
IOException - if an I/O error occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occursCopyright © 2002–2019 The Apache Software Foundation. All rights reserved.