Difference between revisions of "Stream API Functions"

From expecco Wiki (Version 2.x)
Jump to navigation Jump to search
(Die Seite wurde neu angelegt: „This document lists most useful (and most often needed) functions. Be aware, that there are many more to be found in either the class references or via the bui…“)
(No difference)

Revision as of 14:46, 4 December 2019

This document lists most useful (and most often needed) functions. Be aware, that there are many more to be found in either the class references or via the builtin class browser.

Reference: Stream and ExternalStream and Socket

Back to Useful API Functions

Creation[edit]

Internal Streams[edit]
aCollection readStream
aCollection writeStream
External Streams[edit]
pathString asFilename readStream
pathString asFilename writeStream
pathString asFilename appendingWriteStream
Socket newTCPclientToHost:hostNameOrAddress port:aPortOrServiceName

Reading[edit]

next[edit]

Returns the next element from the stream.

aStream next

aStream.next() [JS]

Example:

 s := 'data.txt' asFilename readStream.
 s next.
 => character
nextByte[edit]

Returns the next character as a byte valued integer. Only valid for character streams.

Writing[edit]

nextPut:[edit]

Appends (writes) an element to the stream.

aStream nextPut: someElement

aStream.nextPut(someElement) [JS]

Example:

 s := 'data.txt' asFilename writeStream.
 s nextPut: $a.
 s nextPut: $b.
 s close.
nextPutByte:[edit]

Appends a byte valued integer to the stream. Only valid for character streams.



Copyright © 2014-2018 eXept Software AG