* Reads N bytes * @param {1 | 2 | 4 | 8} size
(size, signed = false, littleEndian = undefined)
| 213 | * @param {1 | 2 | 4 | 8} size |
| 214 | */ |
| 215 | peek(size, signed = false, littleEndian = undefined) { |
| 216 | this.view.getBigInt64; |
| 217 | let m = ""; |
| 218 | if (size === 8) m += "Big"; |
| 219 | m += signed ? "Int" : "Uint"; |
| 220 | m += size * 8; |
| 221 | m = "get" + m; |
| 222 | if (!this.view[m]) { |
| 223 | throw new Error("Method not found: " + m); |
| 224 | } |
| 225 | |
| 226 | return this.view[m](this.offset, littleEndian == null ? this.littleEndian : littleEndian); |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Seeks to the specified position or by the number of bytes specified relative to the current offset |