-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readable: Update docs for a case with a binary safe string reading #5155
Conversation
as strings, always use this method. | ||
called [`buf.toString(encoding)`][] on them. Also you can disable | ||
any encoding at all with `readable.setEncoding(null)`. | ||
If you want to read the data as strings, always use this method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would flip these last two sentences around, or move the new sentence to a separate paragraph.
LGTM with a nit. |
d184b48
to
eb748a2
Compare
@jasnell Could you review? |
@@ -416,6 +416,10 @@ potentially mangled if you simply pulled the Buffers directly and | |||
called [`buf.toString(encoding)`][] on them. If you want to read the data | |||
as strings, always use this method. | |||
|
|||
Also you can disable any encoding at all with `readable.setEncoding(null)`. | |||
This approach is wery usefull if you deal with binary data or with large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useful
eb748a2
to
66bb1b4
Compare
@silverwind thanks! (: |
@@ -416,6 +416,10 @@ potentially mangled if you simply pulled the Buffers directly and | |||
called [`buf.toString(encoding)`][] on them. If you want to read the data | |||
as strings, always use this method. | |||
|
|||
Also you can disable any encoding at all with `readable.setEncoding(null)`. | |||
This approach is wery useful if you deal with binary data or with large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very
`readable.setEncoding(null)` - may be the most preferable way to proxy a binary data without any encoding/decoding overhead
66bb1b4
to
174fec5
Compare
@silverwind Thanks a lot... Seems I need to install a spell checker for my Sublime. (: |
Landed in 8d8fef0. |
`readable.setEncoding(null)` - may be the most preferable way to proxy a binary data without any encoding/decoding overhead PR-URL: #5155 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`readable.setEncoding(null)` - may be the most preferable way to proxy a binary data without any encoding/decoding overhead PR-URL: #5155 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
I'm 99% sure this applied to v4. Going to give a day before landing for people to chime in and let me know not to land it |
`readable.setEncoding(null)` - may be the most preferable way to proxy a binary data without any encoding/decoding overhead PR-URL: #5155 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`readable.setEncoding(null)` - may be the most preferable way to proxy a binary data without any encoding/decoding overhead PR-URL: #5155 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
readable.setEncoding(null)
- may be the most preferable way to proxy a binary data without any encoding/decoding overheadSee nodejs/readable-stream#180 for details