docs: protected int advanceWriteIndex() {
          int num=0, start=write_index;
          for(;;) {
              if(buf[start] == null)
                  break;
              num++;
              start=index(start+1);
              if(start == tmp_write_index.get())
                  break;
          }
          write_index=start;
          return num;
      }