Is this type of while loop acceptable in Java? -
i have seen form used in snippets , wondering if correct implementation of while loop in java:
while ((bytesread = bin.read(contentbytes)) != -1) { response = new string(contentbytes, 0, bytesread); responsebuffer.append(response); }
it reads byte contentbyte , stores in bytesread, if byte read not end of file (-1 indicates end of file) executes statements in loop body. hope helps
Comments
Post a Comment