I don't really understand what this piece of code does. I mainly want to know what isr.read(inputBuffer)
processes and what the while
loop does. Could someone explain it for me? Thanks.
InputStreamReader isr = new InputStreamReader(is);
int charRead;
char[] inputBuffer = new char[BUFFER_SIZE];
try {
while((charRead = isr.read(inputBuffer)) > 0) {
String readString = String.copyValueOf(inputBuffer, 0, charRead);
XMLContents += readString;
inputBuffer = new char[BUFFER_SIZE];
}
return XMLContents;
} catch(IOException e) {
e.printStackTrace();
return null;
}