public class ReversedLinesFileReader extends Object implements Closeable
| 构造器和说明 |
|---|
ReversedLinesFileReader(File file,
Charset charset)
Creates a ReversedLinesFileReader with default block size of 4KB and the
specified 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.
|
public ReversedLinesFileReader(File file, Charset charset) throws IOException
file - the file to be readcharset - the encoding to useIOException - 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 在接口中 Closeableclose 在接口中 AutoCloseableIOException - if an I/O error occursCopyright © 2022. All rights reserved.