(buffer)
| 284 | } |
| 285 | |
| 286 | write(buffer) { |
| 287 | if (this.error) { |
| 288 | return null; |
| 289 | } |
| 290 | if (!this._parser) { |
| 291 | this._error( |
| 292 | new FormidableError('uninitialized parser', errors.uninitializedParser), |
| 293 | ); |
| 294 | return null; |
| 295 | } |
| 296 | |
| 297 | this.bytesReceived += buffer.length; |
| 298 | this.emit('progress', this.bytesReceived, this.bytesExpected); |
| 299 | |
| 300 | this._parser.write(buffer); |
| 301 | |
| 302 | return this.bytesReceived; |
| 303 | } |
| 304 | |
| 305 | onPart(part) { |
| 306 | // this method can be overwritten by the user |
no test coverage detected