* Take n bytes from the buffered Buffers * @param {number} n * @returns {Buffer}
(n)
| 18002 | __privateGet(this, _info).payloadLength = payloadLength; |
| 18003 | __privateSet(this, _state, parserStates.READ_DATA); |
| 18004 | if (!__privateMethod(this, _validatePayloadLength, validatePayloadLength_fn).call(this)) { |
| 18005 | return; |
| 18006 | } |
| 18007 | } else if (payloadLength === 126) { |
| 18008 | __privateSet(this, _state, parserStates.PAYLOADLENGTH_16); |
| 18009 | } else if (payloadLength === 127) { |
| 18010 | __privateSet(this, _state, parserStates.PAYLOADLENGTH_64); |
| 18011 | } |
| 18012 | if (isTextBinaryFrame(opcode)) { |
| 18013 | __privateGet(this, _info).binaryType = opcode; |
| 18014 | __privateGet(this, _info).compressed = rsv1 !== 0; |
| 18015 | } |
| 18016 | __privateGet(this, _info).opcode = opcode; |
| 18017 | __privateGet(this, _info).masked = masked; |
| 18018 | __privateGet(this, _info).fin = fin; |
| 18019 | __privateGet(this, _info).fragmented = fragmented; |
| 18020 | } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_16) { |
| 18021 | if (__privateGet(this, _byteOffset) < 2) { |
| 18022 | return callback(); |
| 18023 | } |
| 18024 | const buffer = this.consume(2); |
| 18025 | __privateGet(this, _info).payloadLength = buffer.readUInt16BE(0); |
| 18026 | __privateSet(this, _state, parserStates.READ_DATA); |
| 18027 | if (!__privateMethod(this, _validatePayloadLength, validatePayloadLength_fn).call(this)) { |
| 18028 | return; |
| 18029 | } |
| 18030 | } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_64) { |
| 18031 | if (__privateGet(this, _byteOffset) < 8) { |
| 18032 | return callback(); |
| 18033 | } |
| 18034 | const buffer = this.consume(8); |
| 18035 | const upper = buffer.readUInt32BE(0); |
| 18036 | const lower = buffer.readUInt32BE(4); |
no test coverage detected