I am an abstract class that provides interruptable sequential access to
objects. I can return successive objects from a source, or accept
successive objects and store them sequentially on a sink. I provide
some simple iteration over the contents of one of my instances, and
provide for writing collections sequentially.

Answer the whole contents of the receiver, from the next object to
the last

file

Return nil by default; not all streams have a file.

name

Return nil by default; not all streams have a name.

next

Return the next object in the receiver

next: anInteger

Return the next anInteger objects in the receiver

nextAvailable: anInteger

Return up to anInteger objects in the receiver. Besides stopping if
the end of the stream is reached, this may return less than this
number of bytes for various reasons. For example, on files and sockets
this operation could be non-blocking, or could do at most one I/O
operation.

nextAvailable: anInteger into: aCollection startingAt: pos

Place the next anInteger objects from the receiver into aCollection,
starting at position pos. Return the number of items stored.
Besides stopping if the end of the stream is reached, this may
return less than this number of bytes for various reasons.
For example, on files and sockets this operation could be
non-blocking, or could do at most one I/O operation.

nextAvailable: anInteger putAllOn: aStream

Copy up to anInteger objects in the receiver to aStream. Besides
stopping if the end of the stream is reached, this may return
less than this number of bytes for various reasons. For example,
on files and sockets this operation could be non-blocking,
or could do at most one I/O operation.

nextLine

Returns a collection of the same type that the stream accesses, containing
the next line up to the next new-line character. Returns the entire rest of the
stream's contents if no new-line character is found.

nextMatchFor: anObject

Answer whether the next object is equal to anObject. Even if it does
not, anObject is lost

splitAt: anObject

Answer an OrderedCollection of parts of the receiver. A new (possibly
empty) part starts at the start of the receiver, or after every
occurrence of an object which is equal to anObject (as compared by
#=).

upTo: anObject

Returns a collection of the same type that the stream accesses, up to
but not including the object anObject. Returns the entire rest of the
stream's contents if anObject is not present.

upToAll: aCollection

If there is a sequence of objects remaining in the stream that is
equal to the sequence in aCollection, set the stream position just
past that sequence and answer the elements up to, but not including,
the sequence. Else, set the stream position to its end and answer
all the remaining elements.

upToEnd

Answer every item in the collection on which the receiver is
streaming, from the next one to the last

File in the contents of the receiver.
During a file in operation, global variables (starting with an
uppercase letter) that are not declared don't yield an `unknown
variable' error. Instead, they are defined as nil in the `Undeclared'
dictionary (a global variable residing in Smalltalk).
As soon as you add the variable to a namespace (for example by creating
a class) the Association will be removed from Undeclared and reused
in the namespace, so that the old references will automagically point
to the new value.

fileInLine: lineNum file: aFile at: charPosInt

Private - Much like a preprocessor #line directive; it is used internally
by #fileIn, and explicitly by the Emacs Smalltalk mode.

fileInLine: lineNum fileName: aString at: charPosInt

Private - Much like a preprocessor #line directive; it is used internally
by #fileIn, and explicitly by the Emacs Smalltalk mode.

Answer whether the receiver is able to store Unicode characters.
Note that if this method returns true, the stream may or may not
be able to store Characters (as opposed to UnicodeCharacters)
whose value is above 127.

Answer a new stream that concatenates the data in the receiver with the
data in aStream. Both the receiver and aStream should be readable.

collect: aBlock

Answer a new stream that will pass the returned objects through aBlock,
and return whatever object is returned by aBlock instead. Note that when
peeking in the returned stream, the block will be invoked multiple times,
with possibly surprising results.

lines

Answer a new stream that answers lines from the receiver.

peek

Returns the next element of the stream without moving the pointer.
Returns nil when at end of stream. Lookahead is implemented automatically
for streams that are not positionable but can be copied.

peekFor: aCharacter

Returns true and gobbles the next element from the stream of it is
equal to anObject, returns false and doesn't gobble the next element
if the next element is not equal to anObject. Lookahead is implemented
automatically for streams that are not positionable but can be copied.

reject: aBlock

Answer a new stream that only returns those objects for which aBlock
returns false. Note that the returned stream will not be positionable.

select: aBlock

Answer a new stream that only returns those objects for which aBlock
returns true. Note that the returned stream will not be positionable.

Advance the receiver until we find a character that is not a
separator. Answer false if we reach the end of the stream,
else answer true; in this case, sending #next will return the
first non-separator character (possibly the same to which the
stream pointed before #skipSeparators was sent).

skipTo: anObject

Move the current position to after the next occurrence of anObject
and return true if anObject was found. If anObject doesn't exist, the
pointer is atEnd, and false is returned.

skipToAll: aCollection

If there is a sequence of objects remaining in the stream that is
equal to the sequence in aCollection, set the stream position just
past that sequence and answer true. Else, set the stream position
to its end and answer false.

Copy to aStream a more-or-less arbitrary amount of data. When used
on files, this does at most one I/O operation. For other kinds of
stream, the definition may vary. This method is used to do
stream-to-stream copies.