deprecated readLine() What to change?

Posted by user1681751 on Stack Overflow See other posts from Stack Overflow or by user1681751
Published on 2012-11-18T22:52:46Z Indexed on 2012/11/18 23:00 UTC
Read the original article Hit count: 240

I'm trying to get this to work in the eclipse, but the "readLine" is striked through and a notice says it is depreciated, the code works, albeit not the "while ((var2 = var5.readLine()) != null) {" bit.. So I'm wondering how to fix it, a java beginner.

    String var2 = "";
    HttpURLConnection var3 = null;
    DataOutputStream var4 = null;
    DataInputStream var5 = null;

...more code here....

    try
    {
        var5 = new DataInputStream(var3.getInputStream());

        while ((var2 = var5.readLine()) != null) {
            System.out.println("Server Response " + var2);
            ScreenShotHelper.mc.thePlayer.addChatMessage("\u00a7aSuccessfully uploaded screenshot!  Direct link:");
            ScreenShotHelper.mc.thePlayer.addChatMessage("\u00a7a" + var2);
        }

        var5.close();
    }

© Stack Overflow or respective owner

Related posts about java

Related posts about httpurlconnection