java - Breaking out of a do while loop in an async task after parsing all data in a URLConnection -


how end while loop if there 1 line of data or if next line empty?

    bufferedreader in = new bufferedreader(new inputstreamreader(is));     string inputline = "";      try {         {             jsondata += inputline;         }      }         while ((inputline = in.readline()) != null);     } 

you can use,

while ((inputline = in.readline()) != null && !inputline.isempty()); 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -