realloc_(minNewSize) {
    var newSize = 0;

    if (minNewSize > Number.MAX_SAFE_INTEGER - minNewSize) {
      // Cannot grow exponentially without overflow.
      newSize = minNewSize;
    } else {
      newSize = minNewSize * 2;
    }

    if (this.slice_ === null) {
      if (newSize < 128) {
        newSize = 128;
      }
      this.slice_ = new Uint8Array(newSize);
      return;
    }

    const newSlice = new Uint8Array(newSize);
    for (var i = 0; i < this.len_; i++) {
      newSlice[i] = this.slice_[i];
    }

    this.slice_ = newSlice;
  }
/**
   * Reallocates the slice to at least a given size.
   * @param {number} minNewSize The minimum resulting size of the slice.
   * @private
   */
Reallocates the slice to at least a given size.
@param {number} minNewSize The minimum resulting size of the slice.
@private
Reallocates the slice to at least a given size . @param { number } minNewSize The minimum resulting size of the slice . @private
realloc_(minNewSize) {
    var newSize = 0;
    if (minNewSize > Number.MAX_SAFE_INTEGER - minNewSize) {
      newSize = minNewSize;
    } else {
      newSize = minNewSize * 2;
    }
    if (this.slice_ === null) {
      if (newSize < 128) {
        newSize = 128;
      }
      this.slice_ = new Uint8Array(newSize);
      return;
    }
    const newSlice = new Uint8Array(newSize);
    for (var i = 0; i < this.len_; i++) {
      newSlice[i] = this.slice_[i];
    }
    this.slice_ = newSlice;
  }
realloc_ ( minNewSize ) { var newSize = 0 ; if ( minNewSize > Number . MAX_SAFE_INTEGER - minNewSize ) { newSize = minNewSize ; } else { newSize = minNewSize * 2 ; } if ( this . slice_ === null ) { if ( newSize < 128 ) { newSize = 128 ; } this . slice_ = new Uint8Array ( newSize ) ; return ; } const newSlice = new Uint8Array ( newSize ) ; for ( var i = 0 ; i < this . len_ ; i ++ ) { newSlice [ i ] = this . slice_ [ i ] ; } this . slice_ = newSlice ; }
Reallocates the slice to at least a given size.
Reallocates the slice to at least a given size .
// Cannot grow exponentially without overflow.