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

c# - Unity IoC Lifetime per HttpRequest for UserStore -

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

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -