MCPcopy
hub / github.com/gchq/CyberChef / getBytes

Method getBytes

src/core/lib/Stream.mjs:46–56  ·  view source on GitHub ↗

* Get a number of bytes from the current position, or all remaining bytes. * * @param {number} [numBytes=null] * @returns {Uint8Array}

(numBytes=null)

Source from the content-addressed store, hash-verified

44 * @returns {Uint8Array}
45 */
46 getBytes(numBytes=null) {
47 if (this.position > this.length) return undefined;
48
49 const newPosition = numBytes !== null ?
50 this.position + numBytes :
51 this.length;
52 const bytes = this.bytes.slice(this.position, newPosition);
53 this.position = newPosition;
54 this.bitPos = 0;
55 return bytes;
56 }
57
58 /**
59 * Interpret the following bytes as a string, stopping at the next null byte or

Callers 15

extractJPEGFunction · 0.95
extractGIFFunction · 0.95
extractMACHOFunction · 0.95
extractTARFunction · 0.95
extractMP3Function · 0.95
extractPListXMLFunction · 0.95
extractOLE2Function · 0.95
extractBZIP2Function · 0.95
extractDEBFunction · 0.95
extractEVTXFunction · 0.95
parseTLSRecordFunction · 0.95
parseExtensionsFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected