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

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -