@@ -416,6 +416,10 @@ potentially mangled if you simply pulled the Buffers directly and
416
416
called [ ` buf.toString(encoding) ` ] [ ] on them. If you want to read the data
417
417
as strings, always use this method.
418
418
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
+
419
423
``` js
420
424
var readable = getReadableStreamSomehow ();
421
425
readable .setEncoding (' utf8' );
@@ -1712,30 +1716,30 @@ horribly wrong.
1712
1716
[ `'end'` ] : #stream_event_end
1713
1717
[ `'finish'` ] : #stream_event_finish
1714
1718
[ `'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
1720
1724
[ `stream.cork()` ] : #stream_writable_cork
1721
1725
[ `stream.pipe()` ] : #stream_readable_pipe_destination_options
1722
1726
[ `stream.uncork()` ] : #stream_writable_uncork
1723
1727
[ `stream.unpipe()` ] : #stream_readable_unpipe_destination
1724
1728
[ `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
1727
1731
[ API for Stream Consumers ] : #stream_api_for_stream_consumers
1728
1732
[ 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
1731
1735
[ Compatibility ] : #stream_compatibility_with_older_node_js_versions
1732
1736
[ crypto ] : crypto.html
1733
1737
[ 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
1739
1743
[ Object mode ] : #stream_object_mode
1740
1744
[ Readable ] : #stream_class_stream_readable
1741
1745
[ SimpleProtocol v2 ] : #stream_example_simpleprotocol_parser_v2
@@ -1750,7 +1754,7 @@ horribly wrong.
1750
1754
[ stream-read ] : #stream_readable_read_size
1751
1755
[ stream-resume ] : #stream_readable_resume
1752
1756
[ 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
1754
1758
[ Transform ] : #stream_class_stream_transform
1755
1759
[ Writable ] : #stream_class_stream_writable
1756
1760
[ zlib ] : zlib.html
0 commit comments