private String readLine(InputStream stream) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
        return reader.readLine();
    }
private String readLine ( InputStream stream ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( stream ) ) ; return reader . readLine ( ) ; }
This will read a single line from the input stream as a string.

@param stream
The stream to read
@return The line that was read
@throws IOException
If there was a problem reading the line