This repository has been archived by the owner. It is now read-only.
Please sign in to comment.
streams: Support objects other than Buffers
We detect for non-string and non-buffer values in onread and turn the stream into an "objectMode" stream. If we are in "objectMode" mode then howMuchToRead will always return 1, state.length will always have 1 appended to it when there is a new item and fromList always takes the first value from the list. This means that for object streams, the n in read(n) is ignored and read() will always return a single value Fixed a bug with unpipe where the pipe would break because the flowing state was not reset to false. Fixed a bug with sync cb(null, null) in _read which would forget to end the readable stream
- Loading branch information...
Showing with 757 additions and 42 deletions.
- +3 −0 doc/api/stream.markdown
- +42 −10 lib/_stream_readable.js
- +34 −14 lib/_stream_writable.js
- +133 −1 test/simple/test-stream2-basic.js
- +484 −0 test/simple/test-stream2-objects.js
- +20 −9 test/simple/test-stream2-readable-from-list.js
- +16 −1 test/simple/test-stream2-set-encoding.js
- +12 −1 test/simple/test-stream2-transform.js
- +13 −6 test/simple/test-stream2-writable.js
Oops, something went wrong.