UNPKG

@thewtex/vtk.js-esm

Version:

Visualization Toolkit for the Web

24 lines (21 loc) 707 B
import { A as ArrayReader_1 } from './ArrayReader.js'; import { u as utils } from '../utils.js'; function Uint8ArrayReader(data) { ArrayReader_1.call(this, data); } utils.inherits(Uint8ArrayReader, ArrayReader_1); /** * @see DataReader.readData */ Uint8ArrayReader.prototype.readData = function(size) { this.checkOffset(size); if(size === 0) { // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of []. return new Uint8Array(0); } var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size); this.index += size; return result; }; var Uint8ArrayReader_1 = Uint8ArrayReader; export { Uint8ArrayReader_1 as U };