docs: bbBlock findBlockForWrite(Object caller, int version, bbBlock curr, int pos)
      {
          assert mutation_in_progress(caller, version);
          assert (pos >= 0 && "invalid position, positions must be >= 0".length() > 0);
          if (pos > this._buf_limit + 1) {
              throw new BlockedBufferException("writes must be contiguous");
          }
          assert _validate();
          if (curr != null && curr.hasRoomToWrite(pos, 1) == true) {
              if (curr._offset + curr._limit == pos && curr._idx < this._next_block_position) {
                  bbBlock b = this._blocks.get(curr._idx + 1);
                  if (b.containsForWrite(pos)) {
                      curr = b;
                  }
              }
              return curr;
          }
          // we're not going to write into curr, so find out the right block
          bbBlock block;
          if (pos == this._buf_limit) {
              // if we're at the limit the only possible (existing) block
              // will be the very last block - shortcut to optimize append
              assert this._next_block_position > 0;
              block = this._blocks.get(this._next_block_position - 1);
          }
          else if (curr != null && pos == curr._offset + curr._limit) {
              // if our current position is exactly at the end (and we already know
              // we can't write into this block if we can write at all we'll have
              // to write into the next block (inner blocks can't be 0 bytes long)
              block = this._blocks.get(curr._idx + 1);
          }
          else {
              // since we're not at the limit and we don't have a current block
              // we'll go find the block in the list (this is an abnormal case)
              // since append if usual for writing
              block = findBlockHelper(pos, 0, this._next_block_position);
          }
          assert block != null;
          assert block.containsForWrite(pos);
          // chech our candidate block to see if it's the one we'd write into
          if (block.hasRoomToWrite(pos, 1)) {
              return block;
          }
          // at this point, we can't use _curr in any event so we can just
          // move on to the next block since findHelper will have returned
          // either the right block (which it didn't) or the one just in
          // front of the right block - so let's see if there is an allocated
          // block just following this
          if (block._idx < this._next_block_position - 1) {
              block = this._blocks.get(block._idx + 1);
              return block;
          }
          // there wasn't a following block (actually a common case when
          // you're appending) so we have to go ahead an actually add a new block
          int newIdx = block._idx + 1;
          assert newIdx == this._next_block_position;
          bbBlock ret =  this.addBlock(caller
                              ,version
                              ,newIdx
                              ,pos
                              ,this.nextBlockSize(caller, version)
                 );
          return ret;
      }