public class FileReader extends Object implements Closeable, AutoCloseable
Constructor and Description |
---|
FileReader(File file) |
FileReader(File file,
Charset charset) |
FileReader(File file,
Charset charset,
int splitCount) |
FileReader(File file,
Charset charset,
int splitCount,
ForkJoinPool pool) |
FileReader(File file,
int splitCount) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
SortedMap<Integer,String> |
find(int from,
int to,
String regex) |
SortedMap<Integer,String> |
head(int n)
Read first n line
|
SortedMap<Integer,String> |
readAll() |
SortedMap<Integer,String> |
readLines(int from,
int to)
Read from line to line
|
int |
size()
Get lines count of file
|
SortedMap<Integer,String> |
tail(int n)
Read last n line from file
|
public FileReader(File file) throws IOException
IOException
public FileReader(File file, Charset charset) throws IOException
IOException
public FileReader(File file, Charset charset, int splitCount) throws IOException
IOException
public FileReader(File file, Charset charset, int splitCount, ForkJoinPool pool) throws IOException
IOException
public FileReader(File file, int splitCount) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public SortedMap<Integer,String> find(int from, int to, String regex) throws IOException
IOException
public int size()
public SortedMap<Integer,String> head(int n) throws IOException
n
- lineIOException
- IOExceptionpublic SortedMap<Integer,String> readAll() throws IOException
IOException
- IOExceptionpublic SortedMap<Integer,String> readLines(int from, int to) throws IOException
from
- fromto
- toIOException
- IOExceptionpublic SortedMap<Integer,String> tail(int n) throws IOException
n
- lineIOException
- IOExceptionCopyright © 2016–2024 QASymphony. All rights reserved.