function setData(newData, newSizeBits) {
    if ((isDirect(newData) == 0) || (isReadOnly(newData) == 0)) {
      throw "newData must be a direct read-only byte buffer";
    }
    if (newSizeBits.length > 31) {
      throw "sizeBits length must be at most " + 31;
    }
    for (let /** @type{number} */ i = 0; i < 4; ++i) {
      if (newSizeBits[i] != 0) {
        throw "first " + 4 + " must be 0";
      }
    }
    let /** @type{!Int32Array} */ dictionaryOffsets = offsets;
    let /** @type{!Int32Array} */ dictionarySizeBits = sizeBits;
    dictionarySizeBits.set(newSizeBits.subarray(0, 0 + newSizeBits.length), 0);
    let /** @type{number} */ pos = 0;
    let /** @type{number} */ limit = newData.length;
    for (let /** @type{number} */ i = 0; i < newSizeBits.length; ++i) {
      dictionaryOffsets[i] = pos;
      let /** @type{number} */ bits = dictionarySizeBits[i];
      if (bits != 0) {
        if (bits >= 31) {
          throw "newSizeBits values must be less than 31";
        }
        pos += i << bits;
        if (pos <= 0 || pos > limit) {
          throw "newSizeBits is inconsistent: overflow";
        }
      }
    }
    for (let /** @type{number} */ i = newSizeBits.length; i < 32; ++i) {
      dictionaryOffsets[i] = pos;
    }
    if (pos != limit) {
      throw "newSizeBits is inconsistent: underflow";
    }
    data = newData;
  }
@param {!Int8Array} newData
@param {!Int32Array} newSizeBits
@return {void}