@@ -416,6 +416,10 @@ potentially mangled if you simply pulled the Buffers directly and
416416called [ ` buf.toString(encoding) ` ] [ ] on them. If you want to read the data
417417as strings, always use this method.
418418
419+ Also you can disable any encoding at all with ` readable.setEncoding(null) ` .
420+ This approach is very useful if you deal with binary data or with large
421+ multi-byte strings spread out over multiple chunks.
422+
419423``` js
420424var readable = getReadableStreamSomehow ();
421425readable .setEncoding (' utf8' );
@@ -1712,30 +1716,30 @@ horribly wrong.
17121716[ `'end'` ] : #stream_event_end
17131717[ `'finish'` ] : #stream_event_finish
17141718[ `'readable'` ] : #stream_event_readable
1715- [ `buf.toString(encoding)` ] : https://nodejs.org/docs/v5.7 .0/api/buffer.html#buffer_buf_tostring_encoding_start_end
1716- [ `EventEmitter` ] : https://nodejs.org/docs/v5.7 .0/api/events.html#events_class_eventemitter
1717- [ `process.stderr` ] : https://nodejs.org/docs/v5.7 .0/api/process.html#process_process_stderr
1718- [ `process.stdin` ] : https://nodejs.org/docs/v5.7 .0/api/process.html#process_process_stdin
1719- [ `process.stdout` ] : https://nodejs.org/docs/v5.7 .0/api/process.html#process_process_stdout
1719+ [ `buf.toString(encoding)` ] : https://nodejs.org/docs/v5.8 .0/api/buffer.html#buffer_buf_tostring_encoding_start_end
1720+ [ `EventEmitter` ] : https://nodejs.org/docs/v5.8 .0/api/events.html#events_class_eventemitter
1721+ [ `process.stderr` ] : https://nodejs.org/docs/v5.8 .0/api/process.html#process_process_stderr
1722+ [ `process.stdin` ] : https://nodejs.org/docs/v5.8 .0/api/process.html#process_process_stdin
1723+ [ `process.stdout` ] : https://nodejs.org/docs/v5.8 .0/api/process.html#process_process_stdout
17201724[ `stream.cork()` ] : #stream_writable_cork
17211725[ `stream.pipe()` ] : #stream_readable_pipe_destination_options
17221726[ `stream.uncork()` ] : #stream_writable_uncork
17231727[ `stream.unpipe()` ] : #stream_readable_unpipe_destination
17241728[ `stream.wrap()` ] : #stream_readable_wrap_stream
1725- [ `tls.CryptoStream` ] : https://nodejs.org/docs/v5.7 .0/api/tls.html#tls_class_cryptostream
1726- [ `util.inherits()` ] : https://nodejs.org/docs/v5.7 .0/api/util.html#util_util_inherits_constructor_superconstructor
1729+ [ `tls.CryptoStream` ] : https://nodejs.org/docs/v5.8 .0/api/tls.html#tls_class_cryptostream
1730+ [ `util.inherits()` ] : https://nodejs.org/docs/v5.8 .0/api/util.html#util_util_inherits_constructor_superconstructor
17271731[ API for Stream Consumers ] : #stream_api_for_stream_consumers
17281732[ API for Stream Implementors ] : #stream_api_for_stream_implementors
1729- [ child process stdin ] : https://nodejs.org/docs/v5.7 .0/api/child_process.html#child_process_child_stdin
1730- [ child process stdout and stderr ] : https://nodejs.org/docs/v5.7 .0/api/child_process.html#child_process_child_stdout
1733+ [ child process stdin ] : https://nodejs.org/docs/v5.8 .0/api/child_process.html#child_process_child_stdin
1734+ [ child process stdout and stderr ] : https://nodejs.org/docs/v5.8 .0/api/child_process.html#child_process_child_stdout
17311735[ Compatibility ] : #stream_compatibility_with_older_node_js_versions
17321736[ crypto ] : crypto.html
17331737[ Duplex ] : #stream_class_stream_duplex
1734- [ fs read streams ] : https://nodejs.org/docs/v5.7 .0/api/fs.html#fs_class_fs_readstream
1735- [ fs write streams ] : https://nodejs.org/docs/v5.7 .0/api/fs.html#fs_class_fs_writestream
1736- [ HTTP requests, on the client ] : https://nodejs.org/docs/v5.7 .0/api/http.html#http_class_http_clientrequest
1737- [ HTTP responses, on the server ] : https://nodejs.org/docs/v5.7 .0/api/http.html#http_class_http_serverresponse
1738- [ http-incoming-message ] : https://nodejs.org/docs/v5.7 .0/api/http.html#http_class_http_incomingmessage
1738+ [ fs read streams ] : https://nodejs.org/docs/v5.8 .0/api/fs.html#fs_class_fs_readstream
1739+ [ fs write streams ] : https://nodejs.org/docs/v5.8 .0/api/fs.html#fs_class_fs_writestream
1740+ [ HTTP requests, on the client ] : https://nodejs.org/docs/v5.8 .0/api/http.html#http_class_http_clientrequest
1741+ [ HTTP responses, on the server ] : https://nodejs.org/docs/v5.8 .0/api/http.html#http_class_http_serverresponse
1742+ [ http-incoming-message ] : https://nodejs.org/docs/v5.8 .0/api/http.html#http_class_http_incomingmessage
17391743[ Object mode ] : #stream_object_mode
17401744[ Readable ] : #stream_class_stream_readable
17411745[ SimpleProtocol v2 ] : #stream_example_simpleprotocol_parser_v2
@@ -1750,7 +1754,7 @@ horribly wrong.
17501754[ stream-read ] : #stream_readable_read_size
17511755[ stream-resume ] : #stream_readable_resume
17521756[ stream-write ] : #stream_writable_write_chunk_encoding_callback
1753- [ TCP sockets ] : https://nodejs.org/docs/v5.7 .0/api/net.html#net_class_net_socket
1757+ [ TCP sockets ] : https://nodejs.org/docs/v5.8 .0/api/net.html#net_class_net_socket
17541758[ Transform ] : #stream_class_stream_transform
17551759[ Writable ] : #stream_class_stream_writable
17561760[ zlib ] : zlib.html
0 commit comments