0

Error:

String Buffer is unable to convert whole data in String using toString

BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line = "";
StringBuffer  buffer =new StringBuffer();
while ((line = bufferedReader.readLine()) != null) {
    buffer.append(line +"\n");
    Log.d(LOG_TAG, "line:" + line);
}
/* Close Stream */
if (null != inputStream) {
    inputStream.close();
}
Log.d(LOG_TAG, "buffer.toString():" + buffer.toString());
Matt
  • 14,906
  • 27
  • 99
  • 149
  • in the above code it returns only stating few 200 -300 characters converted into String – ankit mishra May 10 '16 at 06:46
  • The log only shows a number of characters. You won't find the whole file in there. – tynn May 10 '16 at 06:49
  • 1
    The log buffer is limited, see here how to change it: http://stackoverflow.com/questions/6321555/what-is-the-size-limit-for-logcat-and-how-to-change-its-capacity And try to log `buffer.toString().length()` to get the real size of your string. – Neria Nachum May 10 '16 at 07:05
  • it was ok actually Log can display limited content in AS ,thanks #Neria Nachum – ankit mishra May 10 '16 at 09:11

0 Answers0