Fix the StreamReader example in the README - #159
Open
sribalakumar wants to merge 1 commit into
Open
sribalakumar wants to merge 1 commit into
sribalakumar wants to merge 1 commit into
Conversation
Since StreamReader#read was changed to return decompressed bytes (and nil
at end of stream), the README example no longer matches. It read a second
'def' that the writer example never produced, and showed '' at end of
data where read now returns nil. Update the example to the writer's
actual output ("abc", then nil) and add a short eof? example.
Author
|
@SpringMT Can you look at these docs changes and let me know if any further changes are required. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small docs follow-up to #151. That change made
StreamReader#readreturn decompressed bytes andnilat the end of the stream, so the README example no longer matches the code:'def', but theStreamWriterexample just above only writes"abc";''at the end of data, wherereadnow returnsnil.This updates the example to the writer's actual output (
"abc", thennil), and adds a shorteof?example since that method is also part of the reader now. Both snippets were run against currentmainto confirm the output shown.