* Modifies the underlying buffer, it concatenates the given buffer with the original (internalBuffer = concat(bytes, internalBuffer)
(bytes)
| 89 | * Modifies the underlying buffer, it concatenates the given buffer with the original (internalBuffer = concat(bytes, internalBuffer) |
| 90 | */ |
| 91 | unshift(bytes) { |
| 92 | if (this.offset > 0) { |
| 93 | throw new Error('Can not modify the underlying buffer if already read'); |
| 94 | } |
| 95 | this.buf = Buffer.concat([bytes, this.buf], bytes.length + this.buf.length); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Reads any number of bytes and moves the offset. |
no outgoing calls
no test coverage detected