Currently I have the below code for reading an InputStream. I am storing the whole file into a StringBuilder variable and processing this string af
InputStream
StringBuilder
This worked for me without any problems.
char charArray[] = new char[ MAX_BUFFER_SIZE ]; int i = 0; int c = 0; while((c = br.read()) != -1 && i < MAX_BUFFER_SIZE) { char character = (char) c; charArray[i++] = character; } return Arrays.copyOfRange(charArray,0,i);