Java BufferedReader Read Line readLine(InputStream in)

Here you can find the source of readLine(InputStream in)

Description

read Line

License

Apache License

Declaration

public static String readLine(InputStream in) 

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;

public class Main {
    public static String readLine(InputStream in) {
        final BufferedReader reader = new BufferedReader(
                new InputStreamReader(in));
        final StringBuilder out = new StringBuilder();
        final String newLine = System.getProperty("line.separator");
        String line;//  ww  w.  j  a v  a 2s  .co  m
        try {
            while ((line = reader.readLine()) != null) {
                out.append(line);
                out.append(newLine);
            }
        } catch (final IOException e) {
            throw new RuntimeException(e);
        }
        return out.toString();
    }
}

Related

  1. readLine(File f)
  2. readLine(File f)
  3. readLine(File file)
  4. readLine(File file, int lineNumber)
  5. readLine(InputStream in)
  6. readLine(InputStream input)
  7. readLine(InputStream input)
  8. readLine(RandomAccessFile wiki)
  9. readLine(Reader rd)