static toArrayBuffer(view) {
    if (!ArrayBuffer.isView(view)) {
      return /** @type {!ArrayBuffer} */(view);
    } else {
      const aView = /** @type {!ArrayBufferView} */(view);
      if (aView.byteOffset == 0 &&
          aView.byteLength == aView.buffer.byteLength) {
        // This is a TypedArray over the whole buffer.
        return aView.buffer;
      }
      // This is a "view" on the buffer.  Create a new buffer that only contains
      // the data.  Note that since this isn't an ArrayBuffer, the "new" call
      // will allocate a new buffer to hold the copy.
      return new Uint8Array(aView).buffer;
    }
  }
Gets an ArrayBuffer that contains the data from the given TypedArray.  Note
this will allocate a new ArrayBuffer if the object is a partial view of
the data.

@param {!BufferSource} view
@return {!ArrayBuffer}
@export