Converts a DataView to an ArrayBuffer
547192
function dataViewToArrayBuffer(str) {
    var bufView = new Uint8Array(dv.byteLength);
    for (var i = 0; i < bufView.length; i++) {
      bufView[i] = dv.getUint8(i);
    }
    return bufView.buffer;
  }
333551
function UInt8ArrayDeserializer(buffer, bufferOffset, arrayLen=null) {
  if (arrayLen === null || arrayLen < 0) {
    arrayLen = getArrayLen(buffer, bufferOffset);
  }

  const array = buffer.slice(bufferOffset[0], bufferOffset[0] + arrayLen);
  bufferOffset[0] += arrayLen;
  return array;
}
395652
function uint8ArrayToArrayBuffer (arr) {
  return arr.buffer.slice(arr.byteOffset, arr.byteLength + arr.byteOffset)
}
622699
function toArrayLike(buf) {
  if (buf instanceof Uint8Array) {
    return buf;
  } else if (buf instanceof ArrayBuffer) {
    return new Uint8Array(buf);
  } else if (Buffer.isBuffer(buf)) {
    return buf;
  } else {
    return buf; // type unknown, trust the user
  }
}
900512
public static WsByteBuffer[] expandBufferArray(WsByteBuffer[] oldList, WsByteBuffer[] newBuffers) {
        if (null == oldList && null == newBuffers) {
            // if both are null then just exit
            return null;
        }

        int oldLen = (null != oldList ? oldList.length : 0);
        int newLen = (null != newBuffers ? newBuffers.length : 0);
        WsByteBuffer[] bb = new WsByteBuffer[oldLen + newLen];
        if (0 < oldLen) {
            System.arraycopy(oldList, 0, bb, 0, oldLen);
        }
        if (0 < newLen) {
            System.arraycopy(newBuffers, 0, bb, oldLen, newLen);
        }
        return bb;
    }
36475
function (dataChannel, info, event) {
        if (event.data instanceof ArrayBuffer) {
          self.dispatchEvent('onReceived', {
            'channelLabel': info.label,
            'buffer': event.data
          });
        } else if (event.data instanceof Blob) {
          self.dispatchEvent('onReceived', {
            'channelLabel': info.label,
            'binary': event.data
          });
        } else if (typeof (event.data) === 'string') {
          self.dispatchEvent('onReceived', {
            'channelLabel': info.label,
            'text': event.data
          });
        }
      }
116252
function Reader(buffer, offset, length, littleEndian) {

            var bufferLength = buffer.byteLength || buffer.length;

            this.offset = offset || 0;
            this.length = length || (bufferLength - this.offset);
            this.littleEndian = littleEndian || false;

            this.view = new DataView(buffer, this.offset, this.length);
        }
984693
private ByteBuffer getDataBuffer(long index) {
    ByteBuffer buf = dataBuffers[(int) (index / segmentSize)];
    buf.position((int) (index % segmentSize));
    return buf;
  }
774811
private static Object getDataFromList(List dataList,int index){
		int size=dataList.size();
		while(size<index+1){
			dataList.add(new HashMap());
			size=dataList.size();
		}
		Object retObj=dataList.get(index);
		return retObj;
	}
688668
function arrayAdapter(to, from, merge)
{
  // reset target array
  to.splice(0);

  // transfer actual values
  from.reduce(function(target, value, index)
  {
    // use `undefined` as always-override value
    target[index] = merge(undefined, value);

    return target;
  }, to);

  return to;
}
1335292
function stringToArrayBuffer(text) {
      if (window.TextEncoder !== undefined) {
        return new TextEncoder().encode(text).buffer;
      }

      var array = new Uint8Array(new ArrayBuffer(text.length));

      for (var i = 0, il = text.length; i < il; i++) {
        var value = text.charCodeAt(i);

        // Replacing multi-byte character with space(0x20).
        array[i] = value > 0xff ? 0x20 : value;
      }

      return array.buffer;
    }
1047790
function __getLengthByArrayBuffers(data) {
	let length = 0;
	for (let key in data) {
		length += data[key].byteLength;
	}
	return length;
}
1215723
private void dataBufferAppend(char[] ch, int start, int length) {
        dataBuffer = (char[]) extendArray(dataBuffer, dataBuffer.length,
                dataBufferPos + length);

        System.arraycopy(ch, start, dataBuffer, dataBufferPos, length);
        dataBufferPos += length;
    }
77168
private void dataBufferAppend(char c) {
        // Expand buffer if necessary.
        if (dataBufferPos >= dataBuffer.length) {
            dataBuffer = (char[]) extendArray(dataBuffer, dataBuffer.length,
                    dataBufferPos);
        }
        dataBuffer[dataBufferPos++] = c;
    }
757345
function toArrayBuffer(buf) {
  if (buf instanceof ArrayBuffer) {
    return buf;
  } else if (Buffer.isBuffer(buf)) {
    return bufferToArrayBuffer(buf);
  } else if (buf instanceof Uint8Array) {
    return bufferToArrayBuffer(buf);
  } else {
    return buf; // type unknown, trust the user
  }
}
59311
private void getMapRow( int currentrow, ByteBuffer rowdata, boolean iscompressed ) throws IOException, DataFormatException {
        // if (logger.isDebugEnabled())
        // {
        // logger.debug("ACCESSING THE FILE at row: " + currentrow +
        // ", rasterMapType = " + rasterMapType +
        // ", numberOfBytesPerValue = " + numberOfBytesPerValue +
        // ", iscompressed = " + iscompressed);
        // }

        if (iscompressed) {
            /* Compressed maps */
            if (rasterMapType == -2) {
                /* Compressed double map */
                readCompressedFPRowByNumber(rowdata, currentrow, addressesofrows, cellFile, numberOfBytesPerValue);
            } else if (rasterMapType == -1) {
                /* Compressed floating point map */
                readCompressedFPRowByNumber(rowdata, currentrow, addressesofrows, cellFile, numberOfBytesPerValue);
            } else if (rasterMapType > 0) {
                /* Compressed integer map */
                readCompressedIntegerRowByNumber(rowdata, currentrow, addressesofrows, cellFile);
            } else {
                // if (logger.isDebugEnabled())
                // logger.error("format not double nor float");
            }
        } else {
            if (rasterMapType < 0) {
                /* Uncompressed floating point map */
                readUncompressedFPRowByNumber(rowdata, currentrow, cellFile, numberOfBytesPerValue);
            } else if (rasterMapType > 0) {
                /* Uncompressed integer map */
                readUncompressedIntegerRowByNumber(rowdata, currentrow, cellFile);
            } else {
                // if (logger.isDebugEnabled())
                // logger.error("Unknown case, iscompressed=" + iscompressed
                // + ", compressed=" + compressed + ", rasterMapType="
                // + rasterMapType);
            }
        }
        return;
    }
1136858
public BufferedImage asBufferedImage(INDArray array, int dataType) {
        return converter2.convert(asFrame(array, dataType));
    }