Opening the book…
Streams offer a better way (compared to collections) to incrementally read and write a sequence of elements. There are easy ways to convert back and forth between streams and collections.
- Streams may be either readable, writeable or both readable and writeable.
- To convert a collection to a stream, define a stream on a collection, e.g.,
ReadStream on: (1 to: 1000), or send the messagesreadStream, etc. to the collection. - To convert a stream to a collection, send the message
contents. - To concatenate large collections, instead of using the comma operator, it is more efficient to create a stream, append the collections to the stream with
nextPutAll:, and extract the result by sendingcontents. - File streams are by default character-based. Send
binaryto explicitly make them binary.
This page titled 12.5: Chapter Summary was last modified on Sat, 19 Dec 2020 08:13:39 GMT and is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by via source content that was edited to the style and standards of the LibreTexts platform.
The book could not be loaded just now.