Andy
- Forum posts: 1
Jul 11, 2017, 9:08:47 PM via Website
Jul 11, 2017 9:08:47 PM via Website
Hi,
I want to read only part of a httpurlconnection response.
Now I have:
while ((line = reader.readLine()) != null) {
sb.append(line);
}
I want to have:
while ((line = reader.readLine()) != null && !line.contains("blah") {
sb.append(line);
}
Meaning, read until the line contains the word blah, then stop. Am I really reading less and improving the data consumption? If not, is there a way to stop reading to decrease consumption or the data is consumed no matter what?
Thanks
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.