Java InputStream Read Line readLines(InputStream inputStream)

Here you can find the source of readLines(InputStream inputStream)

Description

read Lines

License

Apache License

Declaration

public static List<String> readLines(InputStream inputStream) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<String> readLines(InputStream inputStream) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
        List<String> lines = new ArrayList<String>();

        String line = reader.readLine();
        while (line != null) {
            lines.add(line);/*from  w ww.j  a v a  2  s .c  om*/
            line = reader.readLine();
        }
        reader.close();
        return lines;
    }
}

Related

  1. readLines(InputStream input, String encoding)
  2. readLines(InputStream input, String encoding)
  3. readLines(InputStream input, String encoding)
  4. readLines(InputStream input, String encoding)
  5. readLines(InputStream input, String encoding)
  6. readLines(InputStream inputStream)
  7. readLines(InputStream inputStream)
  8. readLines(InputStream is)
  9. readLines(InputStream is)