UNPKG

wombo-dream-api

Version:
44 lines 435 kB
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Buffer | wombo-dream-api</title><meta name="description" content="Documentation for wombo-dream-api"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">wombo-dream-api</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">wombo-dream-api</a></li><li><a href="../modules/_internal_.html">&lt;internal&gt;</a></li><li><a href="_internal_.Buffer.html">Buffer</a></li></ul><h1>Interface Buffer</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">Uint8Array</span><ul class="tsd-hierarchy"><li><span class="target">Buffer</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section tsd-is-inherited tsd-is-external"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#BYTES_PER_ELEMENT" class="tsd-kind-icon">BYTES_<wbr/>PER_<wbr/>ELEMENT</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#_toStringTag_" class="tsd-kind-icon">[to<wbr/>String<wbr/>Tag]</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#buffer" class="tsd-kind-icon">buffer</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#byteLength" class="tsd-kind-icon">byte<wbr/>Length</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#byteOffset" class="tsd-kind-icon">byte<wbr/>Offset</a></li><li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#length" class="tsd-kind-icon">length</a></li></ul></section><section class="tsd-index-section tsd-is-external"><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#_iterator_" class="tsd-kind-icon">[iterator]</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#at" class="tsd-kind-icon">at</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#compare" class="tsd-kind-icon">compare</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#copy" class="tsd-kind-icon">copy</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#copyWithin" class="tsd-kind-icon">copy<wbr/>Within</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#entries" class="tsd-kind-icon">entries</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#equals" class="tsd-kind-icon">equals</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#every" class="tsd-kind-icon">every</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#fill" class="tsd-kind-icon">fill</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#filter" class="tsd-kind-icon">filter</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#find" class="tsd-kind-icon">find</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#findIndex" class="tsd-kind-icon">find<wbr/>Index</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#forEach" class="tsd-kind-icon">for<wbr/>Each</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#includes" class="tsd-kind-icon">includes</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#indexOf" class="tsd-kind-icon">index<wbr/>Of</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#join" class="tsd-kind-icon">join</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#keys" class="tsd-kind-icon">keys</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#lastIndexOf" class="tsd-kind-icon">last<wbr/>Index<wbr/>Of</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#map" class="tsd-kind-icon">map</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readBigInt64BE" class="tsd-kind-icon">read<wbr/>Big<wbr/>Int64BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readBigInt64LE" class="tsd-kind-icon">read<wbr/>Big<wbr/>Int64LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readBigUInt64BE" class="tsd-kind-icon">read<wbr/>BigUInt64BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readBigUInt64LE" class="tsd-kind-icon">read<wbr/>BigUInt64LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readBigUint64BE" class="tsd-kind-icon">read<wbr/>Big<wbr/>Uint64BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readBigUint64LE" class="tsd-kind-icon">read<wbr/>Big<wbr/>Uint64LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readDoubleBE" class="tsd-kind-icon">read<wbr/>DoubleBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readDoubleLE" class="tsd-kind-icon">read<wbr/>DoubleLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readFloatBE" class="tsd-kind-icon">read<wbr/>FloatBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readFloatLE" class="tsd-kind-icon">read<wbr/>FloatLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readInt16BE" class="tsd-kind-icon">read<wbr/>Int16BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readInt16LE" class="tsd-kind-icon">read<wbr/>Int16LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readInt32BE" class="tsd-kind-icon">read<wbr/>Int32BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readInt32LE" class="tsd-kind-icon">read<wbr/>Int32LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readInt8" class="tsd-kind-icon">read<wbr/>Int8</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readIntBE" class="tsd-kind-icon">read<wbr/>IntBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readIntLE" class="tsd-kind-icon">read<wbr/>IntLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUInt16BE" class="tsd-kind-icon">readUInt16BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUInt16LE" class="tsd-kind-icon">readUInt16LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUInt32BE" class="tsd-kind-icon">readUInt32BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUInt32LE" class="tsd-kind-icon">readUInt32LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUInt8" class="tsd-kind-icon">readUInt8</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUIntBE" class="tsd-kind-icon">readUIntBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUIntLE" class="tsd-kind-icon">readUIntLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUint16BE" class="tsd-kind-icon">read<wbr/>Uint16BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUint16LE" class="tsd-kind-icon">read<wbr/>Uint16LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUint32BE" class="tsd-kind-icon">read<wbr/>Uint32BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUint32LE" class="tsd-kind-icon">read<wbr/>Uint32LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUint8" class="tsd-kind-icon">read<wbr/>Uint8</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUintBE" class="tsd-kind-icon">read<wbr/>UintBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#readUintLE" class="tsd-kind-icon">read<wbr/>UintLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#reduce" class="tsd-kind-icon">reduce</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#reduceRight" class="tsd-kind-icon">reduce<wbr/>Right</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#reverse" class="tsd-kind-icon">reverse</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#set" class="tsd-kind-icon">set</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#slice" class="tsd-kind-icon">slice</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#some" class="tsd-kind-icon">some</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#sort" class="tsd-kind-icon">sort</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#subarray" class="tsd-kind-icon">subarray</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#swap16" class="tsd-kind-icon">swap16</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#swap32" class="tsd-kind-icon">swap32</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#swap64" class="tsd-kind-icon">swap64</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#toJSON" class="tsd-kind-icon">toJSON</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#toLocaleString" class="tsd-kind-icon">to<wbr/>Locale<wbr/>String</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#toString" class="tsd-kind-icon">to<wbr/>String</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a href="_internal_.Buffer.html#valueOf" class="tsd-kind-icon">value<wbr/>Of</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-overwrite tsd-is-external"><a href="_internal_.Buffer.html#values" class="tsd-kind-icon">values</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#write" class="tsd-kind-icon">write</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeBigInt64BE" class="tsd-kind-icon">write<wbr/>Big<wbr/>Int64BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeBigInt64LE" class="tsd-kind-icon">write<wbr/>Big<wbr/>Int64LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeBigUInt64BE" class="tsd-kind-icon">write<wbr/>BigUInt64BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeBigUInt64LE" class="tsd-kind-icon">write<wbr/>BigUInt64LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeBigUint64BE" class="tsd-kind-icon">write<wbr/>Big<wbr/>Uint64BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeBigUint64LE" class="tsd-kind-icon">write<wbr/>Big<wbr/>Uint64LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeDoubleBE" class="tsd-kind-icon">write<wbr/>DoubleBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeDoubleLE" class="tsd-kind-icon">write<wbr/>DoubleLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeFloatBE" class="tsd-kind-icon">write<wbr/>FloatBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeFloatLE" class="tsd-kind-icon">write<wbr/>FloatLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeInt16BE" class="tsd-kind-icon">write<wbr/>Int16BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeInt16LE" class="tsd-kind-icon">write<wbr/>Int16LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeInt32BE" class="tsd-kind-icon">write<wbr/>Int32BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeInt32LE" class="tsd-kind-icon">write<wbr/>Int32LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeInt8" class="tsd-kind-icon">write<wbr/>Int8</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeIntBE" class="tsd-kind-icon">write<wbr/>IntBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeIntLE" class="tsd-kind-icon">write<wbr/>IntLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUInt16BE" class="tsd-kind-icon">writeUInt16BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUInt16LE" class="tsd-kind-icon">writeUInt16LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUInt32BE" class="tsd-kind-icon">writeUInt32BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUInt32LE" class="tsd-kind-icon">writeUInt32LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUInt8" class="tsd-kind-icon">writeUInt8</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUIntBE" class="tsd-kind-icon">writeUIntBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUIntLE" class="tsd-kind-icon">writeUIntLE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUint16BE" class="tsd-kind-icon">write<wbr/>Uint16BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUint16LE" class="tsd-kind-icon">write<wbr/>Uint16LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUint32BE" class="tsd-kind-icon">write<wbr/>Uint32BE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUint32LE" class="tsd-kind-icon">write<wbr/>Uint32LE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUint8" class="tsd-kind-icon">write<wbr/>Uint8</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUintBE" class="tsd-kind-icon">write<wbr/>UintBE</a></li><li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="_internal_.Buffer.html#writeUintLE" class="tsd-kind-icon">write<wbr/>UintLE</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited tsd-is-external"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="BYTES_PER_ELEMENT" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagReadonly">Readonly</span> BYTES_<wbr/>PER_<wbr/>ELEMENT<a href="#BYTES_PER_ELEMENT" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">BYTES_<wbr/>PER_<wbr/>ELEMENT<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from Uint8Array.BYTES_PER_ELEMENT</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:2102</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>The size in bytes of each element in the array.</p> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="_toStringTag_" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagReadonly">Readonly</span> [to<wbr/>String<wbr/>Tag]<a href="#_toStringTag_" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">[to<wbr/>String<wbr/>Tag]<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;Uint8Array&quot;</span></div><aside class="tsd-sources"><p>Inherited from Uint8Array.__@toStringTag@166</p><ul><li>Defined in node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:282</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="buffer" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagReadonly">Readonly</span> buffer<a href="#buffer" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">buffer<span class="tsd-signature-symbol">:</span> <a href="../modules/_internal_.html#ArrayBufferLike" class="tsd-signature-type" data-tsd-kind="Type alias">ArrayBufferLike</a></div><aside class="tsd-sources"><p>Inherited from Uint8Array.buffer</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:2107</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>The ArrayBuffer instance referenced by the array.</p> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="byteLength" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagReadonly">Readonly</span> byte<wbr/>Length<a href="#byteLength" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">byte<wbr/>Length<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from Uint8Array.byteLength</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:2112</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>The length in bytes of the array.</p> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="byteOffset" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagReadonly">Readonly</span> byte<wbr/>Offset<a href="#byteOffset" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">byte<wbr/>Offset<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from Uint8Array.byteOffset</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:2117</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>The offset in bytes of the array.</p> </div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="length" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagReadonly">Readonly</span> length<a href="#length" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">length<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from Uint8Array.length</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:2216</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>The length of the array.</p> </div></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-external"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="_iterator_" class="tsd-anchor"></a><h3 class="tsd-anchor-link">[iterator]<a href="#_iterator_" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-kind-icon">[iterator]<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.IterableIterator.html" class="tsd-signature-type" data-tsd-kind="Interface">IterableIterator</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from Uint8Array.__@iterator@90</p><ul><li>Defined in node_modules/typescript/lib/lib.es2015.iterable.d.ts:272</li></ul></aside><h4 class="tsd-returns-title">Returns <a href="_internal_.IterableIterator.html" class="tsd-signature-type" data-tsd-kind="Interface">IterableIterator</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><a id="at" class="tsd-anchor"></a><h3 class="tsd-anchor-link">at<a href="#at" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-kind-icon">at<span class="tsd-signature-symbol">(</span>index<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from Uint8Array.at</p><ul><li>Defined in node_modules/@types/node/globals.d.ts:86</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array.</p> </div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>index: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a id="compare" class="tsd-anchor"></a><h3 class="tsd-anchor-link">compare<a href="#compare" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-external"><li class="tsd-signature tsd-kind-icon">compare<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint8Array</span>, targetStart<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, targetEnd<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, sourceStart<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, sourceEnd<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">1</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">-1</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:707</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>Compares <code>buf</code> with <code>target</code> and returns a number indicating whether <code>buf</code>comes before, after, or is the same as <code>target</code> in sort order. Comparison is based on the actual sequence of bytes in each <code>Buffer</code>.</p> </div><div><ul> <li><code>0</code> is returned if <code>target</code> is the same as <code>buf</code></li> <li><code>1</code> is returned if <code>target</code> should come <em>before</em><code>buf</code> when sorted.</li> <li><code>-1</code> is returned if <code>target</code> should come <em>after</em><code>buf</code> when sorted.</li> </ul> <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-0">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-5">&#39;buffer&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf1</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">from</span><span class="hl-1">(</span><span class="hl-5">&#39;ABC&#39;</span><span class="hl-1">);</span><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf2</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">from</span><span class="hl-1">(</span><span class="hl-5">&#39;BCD&#39;</span><span class="hl-1">);</span><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf3</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">from</span><span class="hl-1">(</span><span class="hl-5">&#39;ABCD&#39;</span><span class="hl-1">);</span><br/><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: 0</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: -1</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf3</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: -1</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: 1</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf3</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: 1</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">([</span><span class="hl-0">buf1</span><span class="hl-1">, </span><span class="hl-0">buf2</span><span class="hl-1">, </span><span class="hl-0">buf3</span><span class="hl-1">].</span><span class="hl-4">sort</span><span class="hl-1">(</span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-0">compare</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: [ &lt;Buffer 41 42 43&gt;, &lt;Buffer 41 42 43 44&gt;, &lt;Buffer 42 43 44&gt; ]</span><br/><span class="hl-7">// (This result is equal to: [buf1, buf3, buf2].)</span> </code></pre> <p>The optional <code>targetStart</code>, <code>targetEnd</code>, <code>sourceStart</code>, and <code>sourceEnd</code>arguments can be used to limit the comparison to specific ranges within <code>target</code>and <code>buf</code> respectively.</p> <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-0">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-5">&#39;buffer&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf1</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">from</span><span class="hl-1">([</span><span class="hl-9">1</span><span class="hl-1">, </span><span class="hl-9">2</span><span class="hl-1">, </span><span class="hl-9">3</span><span class="hl-1">, </span><span class="hl-9">4</span><span class="hl-1">, </span><span class="hl-9">5</span><span class="hl-1">, </span><span class="hl-9">6</span><span class="hl-1">, </span><span class="hl-9">7</span><span class="hl-1">, </span><span class="hl-9">8</span><span class="hl-1">, </span><span class="hl-9">9</span><span class="hl-1">]);</span><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf2</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">from</span><span class="hl-1">([</span><span class="hl-9">5</span><span class="hl-1">, </span><span class="hl-9">6</span><span class="hl-1">, </span><span class="hl-9">7</span><span class="hl-1">, </span><span class="hl-9">8</span><span class="hl-1">, </span><span class="hl-9">9</span><span class="hl-1">, </span><span class="hl-9">1</span><span class="hl-1">, </span><span class="hl-9">2</span><span class="hl-1">, </span><span class="hl-9">3</span><span class="hl-1">, </span><span class="hl-9">4</span><span class="hl-1">]);</span><br/><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">, </span><span class="hl-9">5</span><span class="hl-1">, </span><span class="hl-9">9</span><span class="hl-1">, </span><span class="hl-9">0</span><span class="hl-1">, </span><span class="hl-9">4</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: 0</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">, </span><span class="hl-9">0</span><span class="hl-1">, </span><span class="hl-9">6</span><span class="hl-1">, </span><span class="hl-9">4</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: -1</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf1</span><span class="hl-1">.</span><span class="hl-4">compare</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">, </span><span class="hl-9">5</span><span class="hl-1">, </span><span class="hl-9">6</span><span class="hl-1">, </span><span class="hl-9">5</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: 1</span> </code></pre> <p><code>ERR_OUT_OF_RANGE</code> is thrown if <code>targetStart &lt; 0</code>, <code>sourceStart &lt; 0</code>,<code>targetEnd &gt; target.byteLength</code>, or <code>sourceEnd &gt; source.byteLength</code>.</p> </div><dl class="tsd-comment-tags"><dt>since</dt><dd><p>v0.11.13</p> </dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>target: <span class="tsd-signature-type">Uint8Array</span></h5><div class="tsd-comment tsd-typography"><div class="lead"> <p>A <code>Buffer</code> or {@link Uint8Array} with which to compare <code>buf</code>.</p> </div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> targetStart: <span class="tsd-signature-type">number</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> targetEnd: <span class="tsd-signature-type">number</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> sourceStart: <span class="tsd-signature-type">number</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> sourceEnd: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">0</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">1</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">-1</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a id="copy" class="tsd-anchor"></a><h3 class="tsd-anchor-link">copy<a href="#copy" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-external"><li class="tsd-signature tsd-kind-icon">copy<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint8Array</span>, targetStart<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, sourceStart<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, sourceEnd<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/buffer.d.ts:761</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead"> <p>Copies data from a region of <code>buf</code> to a region in <code>target</code>, even if the <code>target</code>memory region overlaps with <code>buf</code>.</p> </div><div><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set"><code>TypedArray.prototype.set()</code></a> performs the same operation, and is available for all TypedArrays, including Node.js <code>Buffer</code>s, although it takes different function arguments.</p> <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-0">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-5">&#39;buffer&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-7">// Create two `Buffer` instances.</span><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf1</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">allocUnsafe</span><span class="hl-1">(</span><span class="hl-9">26</span><span class="hl-1">);</span><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf2</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">allocUnsafe</span><span class="hl-1">(</span><span class="hl-9">26</span><span class="hl-1">).</span><span class="hl-4">fill</span><span class="hl-1">(</span><span class="hl-5">&#39;!&#39;</span><span class="hl-1">);</span><br/><br/><span class="hl-6">for</span><span class="hl-1"> (</span><span class="hl-2">let</span><span class="hl-1"> </span><span class="hl-0">i</span><span class="hl-1"> = </span><span class="hl-9">0</span><span class="hl-1">; </span><span class="hl-0">i</span><span class="hl-1"> &lt; </span><span class="hl-9">26</span><span class="hl-1">; </span><span class="hl-0">i</span><span class="hl-1">++) {</span><br/><span class="hl-1"> </span><span class="hl-7">// 97 is the decimal ASCII value for &#39;a&#39;.</span><br/><span class="hl-1"> </span><span class="hl-0">buf1</span><span class="hl-1">[</span><span class="hl-0">i</span><span class="hl-1">] = </span><span class="hl-0">i</span><span class="hl-1"> + </span><span class="hl-9">97</span><span class="hl-1">;</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-7">// Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.</span><br/><span class="hl-0">buf1</span><span class="hl-1">.</span><span class="hl-4">copy</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">, </span><span class="hl-9">8</span><span class="hl-1">, </span><span class="hl-9">16</span><span class="hl-1">, </span><span class="hl-9">20</span><span class="hl-1">);</span><br/><span class="hl-7">// This is equivalent to:</span><br/><span class="hl-7">// buf2.set(buf1.subarray(16, 20), 8);</span><br/><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf2</span><span class="hl-1">.</span><span class="hl-4">toString</span><span class="hl-1">(</span><span class="hl-5">&#39;ascii&#39;</span><span class="hl-1">, </span><span class="hl-9">0</span><span class="hl-1">, </span><span class="hl-9">25</span><span class="hl-1">));</span><br/><span class="hl-7">// Prints: !!!!!!!!qrst!!!!!!!!!!!!!</span> </code></pre> <pre><code class="language-js"><span class="hl-6">import</span><span class="hl-1"> { </span><span class="hl-0">Buffer</span><span class="hl-1"> } </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-5">&#39;buffer&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-7">// Create a `Buffer` and copy data from one region to an overlapping region</span><br/><span class="hl-7">// within the same `Buffer`.</span><br/><br/><span class="hl-2">const</span><span class="hl-1"> </span><span class="hl-3">buf</span><span class="hl-1"> = </span><span class="hl-0">Buffer</span><span class="hl-1">.</span><span class="hl-4">allocUnsafe</span><span class="hl-1">(</span><span class="hl-9">26</span><span class="hl-1">);</span><br/><br/><span class="hl-6">for</span><span class="hl-1"> (</span><span class="hl-2">let</span><span class="hl-1"> </span><span class="hl-0">i</span><span class="hl-1"> = </span><span class="hl-9">0</span><span class="hl-1">; </span><span class="hl-0">i</span><span class="hl-1"> &lt; </span><span class="hl-9">26</span><span class="hl-1">; </span><span class="hl-0">i</span><span class="hl-1">++) {</span><br/><span class="hl-1"> </span><span class="hl-7">// 97 is the decimal ASCII value for &#39;a&#39;.</span><br/><span class="hl-1"> </span><span class="hl-0">buf</span><span class="hl-1">[</span><span class="hl-0">i</span><span class="hl-1">] = </span><span class="hl-0">i</span><span class="hl-1"> + </span><span class="hl-9">97</span><span class="hl-1">;</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-0">buf</span><span class="hl-1">.</span><span class="hl-4">copy</span><span class="hl-1">(</span><span class="hl-0">buf</span><span class="hl-1">, </span><span class="hl-9">0</span><span class="hl-1">, </span><span class="hl-9">4</span><span class="hl-1">, </span><span class="hl-9">10</span><span class="hl-1">);</span><br/><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-4">log</span><span class="hl-1">(</span><span class="hl-0">buf</span><span class="hl-1">.</span><span class="hl-4">toString</span><span class="hl-1">());</span><br/><span class="hl-7">// Prints: efghijghijklmnopqrstuvwxyz</span> </code></pre> </div><dl class="tsd-comment-tags"><dt>since</dt><dd><p>v0.1.90</p> </dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>target: <span class="tsd-signature-type">Uint8Array</span></h5><div class="tsd-comment tsd-typography"><div class="lead"> <p>A <code>Buffer</code> or {@link Uint8Array} to copy into.</p> </div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> targetStart: <span class="tsd-signature-type">number</span></h5></li><li><h5><span class="tsd-flag ts-flagOpti