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 input)
Get the contents of an InputStream as a list of Strings, one entry per line, using the default character encoding of the platform.
InputStreamReader reader = new InputStreamReader(input);
return readLines(reader);
ListreadLines(InputStream input, String encoding)
Get the contents of an InputStream as a list of Strings, one entry per line, using the specified character encoding.
if (encoding == null) {
    return readLines(input);
} else {
    InputStreamReader reader = new InputStreamReader(input, encoding);
    return readLines(reader);
ListreadLines(InputStream input, String encoding)
Get the contents of an InputStream as a list of Strings, one entry per line, using the specified character encoding.
if (encoding == null) {
    return readLines(input);
} else {
    InputStreamReader reader = new InputStreamReader(input, encoding);
    return readLines(reader);
ListreadLines(InputStream input, String encoding)
read Lines
if (encoding == null) {
    return readLines(input);
} else {
    InputStreamReader reader = new InputStreamReader(input, encoding);
    return readLines(reader);
ListreadLines(InputStream input, String encoding)
read Lines
if (encoding == null) {
    return readLines(input);
InputStreamReader reader = new InputStreamReader(input, encoding);
return readLines(reader);
ListreadLines(InputStream input, String encoding)
Get the contents of an InputStream as a list of Strings, one entry per line, using the specified character encoding.
if (encoding == null) {
    return readLines(input);
} else {
    InputStreamReader reader = new InputStreamReader(input, encoding);
    return readLines(reader);
ListreadLines(InputStream inputStream)
read Lines
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
List<String> lines = new ArrayList<String>();
String line = reader.readLine();
while (line != null) {
    lines.add(line);
    line = reader.readLine();
reader.close();
...
String[]readLines(InputStream inputStream)
Read a UTF-8 file into an array of lines and close the stream.
BufferedReader in = null;
try {
    ArrayList lines = new ArrayList();
    in = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
    String line;
    while ((line = in.readLine()) != null)
        lines.add(line);
    return (String[]) lines.toArray(new String[lines.size()]);
...
ListreadLines(InputStream inputStream)
read Lines
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
List<String> lines = new ArrayList<String>();
String line;
while ((line = bufferedReader.readLine()) != null) {
    lines.add(line);
bufferedReader.close();
return lines;
...
ListreadLines(InputStream is)
Read all the lines from a stream into a list
List<String> res = new ArrayList<String>();
InputStreamReader isR = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isR);
String s;
while ((s = br.readLine()) != null) {
    res.add(s);
return res;
...