(array, byteOffset, length)
| 255 | return fromArrayLike(arrayView); |
| 256 | } |
| 257 | function fromArrayBuffer(array, byteOffset, length) { |
| 258 | if (byteOffset < 0 || array.byteLength < byteOffset) { |
| 259 | throw new RangeError('"offset" is outside of buffer bounds'); |
| 260 | } |
| 261 | if (array.byteLength < byteOffset + (length || 0)) { |
| 262 | throw new RangeError('"length" is outside of buffer bounds'); |
| 263 | } |
| 264 | var buf; |
| 265 | if (byteOffset === undefined && length === undefined) { |
| 266 | buf = new Uint8Array(array); |
| 267 | } else if (length === undefined) { |
| 268 | buf = new Uint8Array(array, byteOffset); |
| 269 | } else { |
| 270 | buf = new Uint8Array(array, byteOffset, length); |
| 271 | } |
| 272 | |
| 273 | // Return an augmented `Uint8Array` instance |
| 274 | Object.setPrototypeOf(buf, Buffer.prototype); |
| 275 | return buf; |
| 276 | } |
| 277 | function fromObject(obj) { |
| 278 | if (Buffer.isBuffer(obj)) { |
| 279 | var len = checked(obj.length) | 0; |
no outgoing calls
no test coverage detected
searching dependent graphs…