Java Utililty Methods InputStreamReader Read

List of utility methods to do InputStreamReader Read

Description

The list of methods to do InputStreamReader Read are organized into topic(s).

Method

ArrayListreadFile(String fileNm)
read File
ArrayList<String> lines = null;
FileReader fr = null;
BufferedReader br = null;
try {
    fr = new FileReader(new File(fileNm));
    br = new BufferedReader(fr);
    lines = new ArrayList<String>();
    String line = null;
...
ListreadFile(String filePath)
readFile
try {
    File file = new File(filePath);
    FileInputStream fis = new FileInputStream(file);
    BufferedReader br = new BufferedReader(new InputStreamReader(fis));
    List rowList = new ArrayList();
    String line = "";
    while ((line = br.readLine()) != null) {
        rowList.add(line);
...
Object[]readFile(String filePath)
get object list from file .
if (filePath == null) {
    filePath = "";
filePath = filePath.replaceAll(" ", "");
File file = new File(filePath);
List<String> list = new ArrayList<String>();
if (file != null && file.getAbsolutePath() != null && !file.getAbsolutePath().equals("") && file.exists()
        && !file.isDirectory()) {
...
LinkedListreadFile(String filePath)
Read file into list
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "UTF-8"));
return read(reader);
StringreadFile(String filePath)
read File
String rs;
FileInputStream fos;
Reader reader;
BufferedReader buferReader;
StringBuilder text;
try {
    fos = new FileInputStream(filePath);
    reader = new java.io.InputStreamReader(fos, "UTF-8");
...
StringreadFile(String filePath)
Returns the text of the specified file.
String encoding = getEncoding(filePath);
BufferedReader bufferedReader = null;
StringBuilder text = new StringBuilder();
try {
    bufferedReader = new BufferedReader(
            new InputStreamReader(new FileInputStream(filePath), "windows-1252"));
    char[] buffer = new char[1024 * 16];
    int length;
...
StringreadFile(String filePath)
read File
String fileContent = "";
try {
    File f = new File(filePath);
    if (f.isFile() && f.exists()) {
        InputStreamReader read = new InputStreamReader(new FileInputStream(f), "UTF-8");
        BufferedReader reader = new BufferedReader(read);
        String line;
        while ((line = reader.readLine()) != null) {
...
StringreadFile(String filePath, String charsetName, long lineNow, long lineEnd)
read File
StringBuffer sb = new StringBuffer();
BufferedReader br = null;
try {
    br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), charsetName));
    String data = null;
    int i = 0;
    while ((data = br.readLine()) != null) {
        if (i <= lineEnd && i >= lineNow) {
...
StringreadFile(String input)
read the content from a file;
char[] buffer = new char[4096];
int len = 0;
StringBuffer content = new StringBuffer(4096);
InputStreamReader fr = null;
BufferedReader br = null;
try {
    fr = new InputStreamReader(new FileInputStream(input), ENCODING);
    br = new BufferedReader(fr);
...
StringreadFile(String location)
read File
try {
    InputStream in = new FileInputStream(new File(location));
    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
    StringBuilder out = new StringBuilder();
    String line;
    while ((line = reader.readLine()) != null) {
        out.append(line);
    reader.close();
    return out.toString();
} catch (Exception e) {
    System.out.println(String.format("CWD = %s", System.getProperty("user.dir")));
    System.out.println(e);
    return "";