joyent/node — pull request #8002 by benjamincburns (2014-07-26 14:14:59+00:00)
Title: fs: Add DuplexStream and fs.createDuplexStream

This adds a `DuplexStream` and matching `createDuplexStream` function to the fs module. Similar to how `Duplex` uses parasitic inheritance from the `Writable` class, I've implemented this by inheriting prototypically from `Duplex` and parasitically from `ReadStream` and `WriteStream`.

Please note that I had to modify slightly the `ReadStream` class to make this work. The only modification necessary was to prefix the `end` member (undocumented and used in a private context), so it is now `_end`. This prevents this field from clashing with the `end` method specified by the `Duplex` stream.