Java Utililty Methods InputStream Read Line

List of utility methods to do InputStream Read Line

Description

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

Method

ListreadLines(InputStream is)
Load the content of InputStream into a string List.
try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
    List<String> ret = new ArrayList<String>();
    while (reader.ready()) {
        ret.add(reader.readLine());
    return ret;
} finally {
...
ListreadLines(InputStream is)
read Lines
return readLines(is, true, new String[] { "#", "//" });
String[]readLines(InputStream is)
read lines.
List<String> lines = new ArrayList<String>();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
try {
    String line;
    while ((line = reader.readLine()) != null) {
        lines.add(line);
    return lines.toArray(new String[0]);
...
ListreadLines(InputStream is)
read Lines
List<String> answer = new ArrayList<String>();
LineNumberReader reader = new LineNumberReader(new InputStreamReader(is));
String line = reader.readLine();
while (line != null) {
    answer.add(line);
    line = reader.readLine();
return answer;
...
String[]readLines(InputStream is)
read lines.
List<String> lines = new ArrayList<String>();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
try {
    String line;
    while ((line = reader.readLine()) != null)
        lines.add(line);
    return lines.toArray(new String[0]);
} finally {
...
ListreadLines(InputStream is)
read Lines
List<String> fileContent = new ArrayList<String>();
try {
    InputStreamReader read = new InputStreamReader(is, "utf-8");
    BufferedReader reader = new BufferedReader(read);
    String line;
    while ((line = reader.readLine()) != null) {
        fileContent.add(line);
    read.close();
    is.close();
} catch (Exception e) {
    e.printStackTrace();
return fileContent;
String[]readLines(InputStream is2, String encoding)
Breaks the contents of the given input stream into an array of strings.
BufferedReader reader = null;
try {
    reader = new BufferedReader(new InputStreamReader(is2, encoding));
    StringBuffer sb = new StringBuffer();
    List list = new ArrayList();
    while (true) {
        int c = reader.read();
        if (c == -1)
...
String[]readLines(InputStream is2, String encoding)
Breaks the contents of the given input stream into an array of strings.
BufferedReader reader = null;
try {
    reader = new BufferedReader(new InputStreamReader(is2, encoding));
    StringBuffer sb = new StringBuffer();
    List<String> list = new ArrayList<String>();
    while (true) {
        int c = reader.read();
        if (c == -1) {
...
ListreadLines(InputStream stream)
read Lines
return splitMultiline(readString(stream), false);
ListreadLines(InputStream stream)
read Lines
return readLines(stream, "UTF-8");