Next: , Up: Stream   [Index]


1.157.1 Stream: accessing-reading

contents

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


Next: , Up: Stream   [Index]