| 4751 | } |
| 4752 | |
| 4753 | var Duplexify = function(writable, readable, opts) { |
| 4754 | if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) |
| 4755 | stream.Duplex.call(this, opts) |
| 4756 | |
| 4757 | this._writable = null |
| 4758 | this._readable = null |
| 4759 | this._readable2 = null |
| 4760 | |
| 4761 | this._forwardDestroy = !opts || opts.destroy !== false |
| 4762 | this._forwardEnd = !opts || opts.end !== false |
| 4763 | this._corked = 1 // start corked |
| 4764 | this._ondrain = null |
| 4765 | this._drained = false |
| 4766 | this._forwarding = false |
| 4767 | this._unwrite = null |
| 4768 | this._unread = null |
| 4769 | this._ended = false |
| 4770 | |
| 4771 | this.destroyed = false |
| 4772 | |
| 4773 | if (writable) this.setWritable(writable) |
| 4774 | if (readable) this.setReadable(readable) |
| 4775 | } |
| 4776 | |
| 4777 | util.inherits(Duplexify, stream.Duplex) |
| 4778 | |