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

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -