0

I am reading from InputStreamReader but I only get the first 10,000 characters of the text that is supposed to come. Any idea what the problem may be? If there is no solution with this class, what are my alternatives?

I found this about InputStreamReader: "The buffer size is 8K." (http://developer.android.com/reference/java/io/InputStreamReader.html). Could this be the answer?

Any pointers really appreciated

    StringBuilder sb = new StringBuilder();  

    BufferedReader br = new BufferedReader(new InputStreamReader(  
      httpcon.getInputStream(),"utf-8"));  
    String line = null;  
    while ((line = br.readLine()) != null) {  
        sb.append(line);               
    }                  
    br.close();  
    result = sb.toString();
Walls
  • 3,972
  • 6
  • 37
  • 52
Egis
  • 879
  • 2
  • 9
  • 13

1 Answers1

0

8K buffer would mean 8000 bytes and since one character is one byte that would seem to make some sense as to your problem. But what is confusing is that you get 10,000 characters.

TronicZomB
  • 8,667
  • 7
  • 35
  • 50
  • your answer makes sense. Thank you for thinking about it – Egis Mar 08 '13 at 17:24
  • You're quite welcome. If it was the answer you're looking for then you could kindly accept. :) – TronicZomB Mar 08 '13 at 17:25
  • of course, but I still hoping for more pointers on this since I am still stuck :) – Egis Mar 08 '13 at 17:32
  • solved the issue. Apparently, I was getting all of my characters, not just 10k. I could only see 10k on the Eclipse's debugger :) Thanks for thinking about it. – Egis Mar 10 '13 at 14:45