readUpTo = n => {
			ensureBuffer();
			const rem =
				/** @type {Buffer} */
				(currentBuffer).length - currentPosition;
			if (rem < n) {
				n = rem;
			}
			const b = /** @type {Buffer} */ (currentBuffer);
			const res = Buffer.from(b.buffer, b.byteOffset + currentPosition, n);
			currentPosition += n;
			checkOverflow();
			return res;
		}
Reads up to n bytes
@param {number} n amount of bytes to read
@returns {Buffer} buffer with bytes