Style-nit: This is obtuse.  We don't do this anywhere even though it is shorter way to read the code.  I think we would prefer:

  for (;;) {
    int r = is.read(contentReadBuffer);
    if (r <= 0)
      break;
    length += r;
  }