eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Stream':

Home

everywhere
www.exept.de
for:
[back]

Class: Stream


Inheritance:

   Object
   |
   +--Stream
      |
      +--CollectingReadStream
      |
      +--Comanche::BufferStream
      |
      +--Comanche::DummyStream
      |
      +--CompressionStream
      |
      +--ConsStream
      |
      +--HashStream
      |
      +--JSONReader
      |
      +--PeekableStream
      |
      +--PrinterStream
      |
      +--RBScanner
      |
      +--Random
      |
      +--SelectingReadStream
      |
      +--SourceCodeStream

Package:
stx:libbasic
Category:
Streams
Version:
rev: 1.185 date: 2009/12/17 15:52:07
user: stefan
file: Stream.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Claus Gittinger

Description:


An abstract class defining common behavior for all stream-like objects.
See concrete subclasses for more detail.

The protocol as implemented here is often only provided as a fallBack
for very uncommon cases. Much of it is redefined for performance.
(In streams which know more about their internal representation ...)


Subclasses should (at least) implement:
    #next           (if readable)
    #nextPut:       (if writable)
    #contents
    #atEnd
    #isReadable
    #isWritable

Peekable & Positionable streams should (at least) implement:
    #peek
    #position
    #position:


[instance variables:]
    signalAtEnd             <nil | Boolean> controls behavior when a read
                                            is attempted past the end-of-stream
                                            if true, the endOfStreamSignal is raised.
                                            if false, nil is returned.
                                            if nil (the default), the signal
                                            is raised, but if there is no handler,
                                            nil is returned.
    
[Class variables / Exceptions:]
    StreamError             <Exception>     parent of all stream errors

    PositionError           <Exception>     position attemted on a stream
                                            which does not support positioning,
                                            or if the position is invalid.

    ReadError               <Exception>     raised on read errors

    WriteError              <Exception>     raised on write errors

    EndOfStreamSignal       <Signal>        raised at end of stream if signalAtEnd
                                            is enabled.


Class protocol:

Signal constants
o  endOfStreamSignal
return the signal raised if read past end of stream is attemted

o  incompleteNextCountSignal
return the signal raised if not all requested elements are returned

o  lineTooLongErrorSignal
return the signal raised if a line is read which is too long (>32k)

o  positionErrorSignal
return the signal raised if positioning is requested for
a stream which does not support that kind of operation

o  readErrorSignal
return the signal raised on read errors

o  streamErrorSignal
return the parent of all stream errors;
handling this one also handles all other errors.
Also, this one may be raised for errors not related to read/write
operations, such as failed ioctls in externalStream etc.

o  writeErrorSignal
return the signal raised on write errors

constants
o  chunkSeparator
return the chunk-separation character

initialization
o  initSignals

o  initialize

instance creation
o  new
report an error - Streams are created using on:-messages


Instance protocol:

JS syntactic sugar
o  show: aString _: arg1
for JS easy syntax - allows: Transcript.show('format %1', arg1)

o  show: aString _: arg1 _: arg2
for JS easy syntax - allows: Transcript.show('format %1 %2', arg1, arg2)

o  show: aString _: arg1 _: arg2 _: arg3
for JS easy syntax - allows: Transcript.show('format %1 %2', arg1,...)

o  show: aString _: arg1 _: arg2 _: arg3 _: arg4
for JS easy syntax - allows: Transcript.show('format %1 %2', arg1,...)

o  show: aString _: arg1 _: arg2 _: arg3 _: arg4 _: arg5
for JS easy syntax - allows: Transcript.show('format %1 %2', arg1,...)

o  showCR: aString _: arg1
for JS easy syntax - allows: Transcript.showCR('format %1', arg1)

o  showCR: aString _: arg1 _: arg2
for JS easy syntax - allows: Transcript.showCR('format %1 %2', arg1, arg2)

o  showCR: aString _: arg1 _: arg2 _: arg3
for JS easy syntax - allows: Transcript.showCR('format %1 %2', arg1,...)

o  showCR: aString _: arg1 _: arg2 _: arg3 _: arg4
for JS easy syntax - allows: Transcript.showCR('format %1 %2', arg1,...)

o  showCR: aString _: arg1 _: arg2 _: arg3 _: arg4 _: arg5
for JS easy syntax - allows: Transcript.showCR('format %1 %2', arg1,...)

accessing
o  contents
return the entire contents of the stream.
For a readStream, that is the rest (i.e. upToEnd),
for a writeStream, that is the collected data. As we do not know here,
what we are, this is the responsibility of a subclass...

** This method raises an error - it must be redefined in concrete classes **

o  signalAtEnd
return the signalAtEnd flag setting.
If true, reading past the end will always raise an EndOfStream exception.
If false, no exception is raised and nil is returned from all reading messages.
If nil (default), the exception is raised if there is a handler; otherwise, nil is returned.
The default is nil (for ST80 compatibility) i.e. to only raise a signal if there is a handler.

o  signalAtEnd: aBoolean
set the signalAtEnd flag setting. If true, reading past the end
will raise an EndOfStream exception. If false, no exception is
raised and nil is returned from all reading messages.
The default is to raise a signal, but return nil if
not handled.

closing
o  close
close the stream - nothing done here.
Added for compatibility with external streams.

converting
o  asStream

emphasis
o  bold
set emphasis to #bold.
this allows Streams to be used interchangeable with printStreams

o  boldItalic
set emphasis to #boldItalic
this allows Streams to be used interchangeable with printStreams

o  emphasis
ignored here - allows Streams to be used interchangable with
text streams

o  emphasis: anEmphasis
ignored here.
this allows Streams to be used interchangeable with printStreams

o  italic
set emphasis to #italic.
this allows Streams to be used interchangeable with printStreams

o  normal
set emphasis to #normal.
this allows Streams to be used interchangeable with printStreams

o  strikeout
set emphasis to #strikeout.
this allows Streams to be used interchangeable with printStreams

o  underline
set emphasis to #underline.
this allows Streams to be used interchangeable with printStreams

enumerating
o  do: aBlock
evaluate the argument, aBlock for all remaining elements,
up to the end of the stream

o  linesDo: aBlock
evaluate the argument, aBlock for all lines,
up to the end of the stream

error handling
o  checkNilFileStream
Do nothing if this is a valid FileStream
(i.e. the previous open operation was successful).
Also implemented in UndefinedObject, to raise an Error there.

This is an aid for converting from the old error reporting (returning nil)
to the new error reporting (with real Exceptions).

It will vanish as soon as the conversion has been done

o  pastEnd
someone tried to read after the end of the stream.
If signalAtEnd == true, raise a signal. If its false, return nil.
Otherwise raise the signal, but only if handled; otherwise return nil.

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  pastEndRead
someone tried to read after the end of the stream.
If signalAtEnd == true, raise a signal.
If it is false, return nil.
Otherwise raise a notification, which is ignored if not handled;
otherwise return nil.

misc
o  binary
switch to binary mode. In binary mode, reading of text streams
returns byte-valued integers instead of characters; writing expects
byte-valued integers respectively.
Ignored here, but added to make internalStreams protocol compatible
with externalStreams.

o  blocking: aBoolean
set non-blocking mode.
Ignored, since internal streams never block

o  eolMode: aSymbol
Ignored here, but added to make internalStreams protocol compatible
with externalStreams.

o  lineEndCRLF
Ignored here, but added to make internalStreams protocol compatible
with externalStreams.

o  lineEndTransparent
Ignored here, but added to make internalStreams protocol compatible
with externalStreams.

o  text
switch to text mode.
Ignored here, but added to make internalStreams protocol compatible
with externalStreams.

misc functions
o  copy: numberOfBytes into: outStream bufferSize: bufferSize
read from the receiver, and write all data up to count or the end to another stream.
Return the number of bytes which have been transferred

o  copyToEndFrom: inStream
read from inStream, and write all data up to the end to the receiver.
Return the number of bytes which have been transferred.
Same functionality as copyToEnd:, but reversed arg and receiver
(useful in a cascade message of the writeStream)

o  copyToEndInto: outStream
read from the receiver, and write all data up to the end to another stream.
Return the number of bytes which have been transferred

o  copyToEndInto: outStream bufferSize: bufferSize
read from the receiver, and write all data up to the end to another stream.
Return the number of bytes which have been transferred

non homogenous reading
o  nextAvailableBytes: numBytes into: aCollection startingAt: initialIndex
for compatibility with ExternalStream

o  nextByte
return the next byte of the stream
- we do not know here how to do it, it should be redefined in subclass

o  nextBytes: count
read the next count bytes and return it as a byteArray.
If EOF is encountered while reading, a truncated byteArray is returned.
If EOF is already reached before the first byte can be read,
nil is returned.

o  nextBytes: count into: anObject
read the next count bytes into an object and return the number of
bytes read. On EOF, 0 is returned.
If the receiver is some socket/pipe-like stream, an exception
is raised if the connection is broken.

The object must have non-pointer indexed instvars (i.e. it must be
a ByteArray, String, Float- or DoubleArray).
If anObject is a string or byteArray and reused, this provides the
fastest possible physical I/O (since no new objects are allocated).

Use with care - non object oriented i/o.
Warning: in general, you cannot use this method to pass data from other
architectures since it does not care for byte order or float representation.

o  nextBytes: numBytes into: aCollection startingAt: initialIndex
return the next numBytes from the stream. If the end is
reached before, only that many bytes are copyied into the
collection.
Returns the number of bytes that have been actually read.
The receiver must support reading of binary bytes.

Notice: this method is provided here for protocol completeness
with externalStreams - it is normally not used with other
streams.

o  nextBytes: numBytes into: aCollection startingAt: initialIndex blockSize: blockSize
like nextBytes:into:startingAt:, but read in blocks of the given size.
This leads to better beahvior when reading large chunks from a slow device,
such as a cdrom drive (since a single unix-read is not interruptable).

o  nextBytesInto: anObject
read bytes into an object, regardless of binary/text mode.
The number of bytes to read is defined by the objects size.
Return the number of bytes read. On EOF, 0 is returned.
If the receiver is some socket/pipe-like stream, an exception
is raised if the connection is broken.

The object to read into must have non-pointer indexed instvars
(i.e. it must be a ByteArray, String, Float- or DoubleArray).
If anObject is a string or byteArray and reused, this provides the
fastest possible physical I/O (since no new objects are allocated).

Use with care - non object oriented i/o.
Warning: in general, you cannot use this method to pass data from other
architectures since it does not care for byte order or float representation.

o  nextHyperMSB: msbFlag
return a signed hyper (8 bytes) from the stream.
The receiver must support reading of binary bytes.

The msbFlag argument controls if the integer is to be read with
most-significant-byte-first (true) or least-first (false).
This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextIEEEDouble
read an 8-byte IEEE double precision float number

o  nextIEEESingle
read a 4-byte IEEE single precision float number

o  nextLongMSB: msbFlag
return a signed long (4 bytes) from the stream.
The receiver must support reading of binary bytes.

The msbFlag argument controls if the integer is to be read with
most-significant-byte-first (true) or least-first (false).
This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextLongNet
return a signed long (4 bytes) in network byte order from the stream.
The receiver must support reading of binary bytes.

o  nextNumber: numBytes
Return the next n bytes as a positive Integer; bytes are taken msb-first.

o  nextShortMSB: msbFlag
return a signed short (2 bytes) from the stream.
The receiver must support reading of binary bytes.

The msbFlag argument controls if the integer is to be read with
most-significant-byte-first (true) or least-first (false).
This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextShortNet
return a signed short (2 bytes) in network byte order from the stream.
The receiver must support reading of binary bytes.
Network byte order is MSB per definition

o  nextSignedByte
return a signed byte (-128..127) from the stream.
The receiver must support reading of binary bytes.

o  nextUnsigned: numBytes MSB: msbFlag
return a numBytes-sized unsigned (numBytes bytes) from the stream as an Integer.
The receiver must support reading of binary bytes.

The msbFlag argument controls if the integer is to be read with
most-significant-byte-first (true) or least-first (false).
This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextUnsignedHyperMSB: msbFlag
return an unsigned hyper (8 bytes) from the stream.
The receiver must support reading of binary bytes.

The msbFlag argument controls if the integer is to be read with
most-significant-byte-first (true) or least-first (false).
This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextUnsignedLongMSB: msbFlag
return an unsigned long (4 bytes) from the stream.
The receiver must support reading of binary bytes.

The msbFlag argument controls if the integer is to be read with
most-significant-byte-first (true) or least-first (false).
This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextUnsignedLongNet
return an unsigned long (4 bytes) in network byte order from the stream.
The receiver must support reading of binary bytes.

o  nextUnsignedShortMSB: msbFlag
return an unsigned short (2 bytes) from the stream.
The receiver must support reading of binary bytes.

The msbFlag argument controls if the integer is to be read with
most-significant-byte-first (true) or least-first (false).
This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextUnsignedShortNet
return an unsigned short (2 bytes) in network byte order from the stream.
The receiver must support reading of binary bytes.
Network byte order is MSB per definition

non homogenous writing
o  nextLongPut: aNumber
for ST-80 compatibility:
Write the argument, aNumber as a long (four bytes).
The most significant byte is sent first.

o  nextNumber: n put: v
Append to the receiver the argument, v, which is a positive Integer,
as the next n bytes. Bytes are written msb first.
Possibly pad with leading zeros.
The receiver must support writing of binary bytes.

o  nextPutAllUtf8: aString
normal streams can not handle multi-byte characters, so convert them to utf8

o  nextPutByte: aByteValue
write a byte.
Same as nextPut: here; for protocol compatibility with externalStream.

o  nextPutBytes: anObject
write bytes from an object; the number of bytes is defined by
the objects size.
Return the number of bytes written or nil on error.
The object must have non-pointer indexed instvars
(i.e. be a ByteArray, String, Float- or DoubleArray).
Use with care - non object oriented i/o.
Warning: in general, you cannot use this method to pass non-byte data to other
architectures since it does not care for byte order or float representation.

o  nextPutBytes: count from: anObject
write count bytes from an object.
Return the number of bytes written or nil on error.
The object must have non-pointer indexed instvars
(i.e. be a ByteArray, String, Float- or DoubleArray).
Use with care - non object oriented i/o.
Warning: in general, you cannot use this method to pass non-byte data to other
architectures since it does not care for byte order or float representation.

o  nextPutBytes: count from: anObject startingAt: start
write count bytes from an object starting at index start.
Return the number of bytes written.
The object must have non-pointer indexed instvars
(i.e. be a ByteArray, String, Float- or DoubleArray).
Use with care - non object oriented i/o.
This is provided for compatibility with externalStream;
to support binary storage

o  nextPutBytesFrom: anObject
write bytes from an object; the number of bytes is defined by the objects size.
Return the number of bytes written or nil on error.
The object must have non-pointer indexed instvars
(i.e. be a ByteArray, String, Float- or DoubleArray).
Use with care - non object oriented i/o.
Warning: in general, you cannot use this method to pass non-byte data to other
architectures since it does not care for byte order or float representation.

o  nextPutHyper: aNumber MSB: msbFlag
Write the argument, aNumber as a hyper (8 bytes).
If msbFlag is true, data is written most-significant byte first;
otherwise least first.
Returns the receiver on ok, nil on error.
The receiver must support writing of binary bytes.

This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextPutIEEEDouble: aFloat
write an 8-byte IEEE double precision float number

o  nextPutIEEESingle: aFloat
write a 4-byte IEEE single precision float number

o  nextPutLong: aNumber MSB: msbFlag
Write the argument, aNumber as a long (four bytes).
If msbFlag is true, data is written most-significant byte first;
otherwise least first.
Returns the receiver on ok, nil on error.
The receiver must support writing of binary bytes.

This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextPutLongNet: aNumber
Write the argument, aNumber as a long (four bytes) in the network byte order.
Returns the receiver on ok, nil on error.
The receiver must support writing of binary bytes.

o  nextPutShort: aNumber MSB: msbFlag
Write the argument, aNumber as a short (two bytes).
If msbFlag is true, data is written most-significant byte first;
otherwise least first.
Returns the receiver on ok, nil on error.
The receiver must support writing of binary bytes.

This interface is provided to allow talking to external programs,
where its known that the byte order is some definite one.
If you dont care (i.e. talk to other smalltalks) or you can control the
order, please use the corresponding xxxNet methods, which use a standard
network byte order.

o  nextPutShortNet: aNumber
Write the argument, aNumber as a short (two bytes) in the network byte order.
Returns the receiver on ok, nil on error.
The receiver must support writing of binary bytes.
Network byte order is MSB per definition

o  nextPutUtf8: aCharacter
append my UTF-8 representation to the argument, aStream.
Up to 31 bits can be encoded in up to 6 bytes.
However, currently, characters are limited to 16 bits.

o  nextPutWord: aNumber
write the argument, aNumber as a signed short (two bytes);
write msb-first for compatibility with other smalltalks.
The receiver must support writing of binary bytes.
I dont know if it should be named nextPutWord: or nextWordPut:;
one of them will vanish ...

o  nextShortPut: aNumber MSB: msbFlag
for backward compatibility - this will vanish

o  nextTwoBytesPut: anInteger
Write anInteger as the next two bytes of the
receiver stream.

o  nextWordPut: aNumber
for ST-80 compatibility:
Write the argument, aNumber as a short (two bytes).
The most significant byte is sent first.

private
o  contentsSpecies
this should return the class of which an instance is
returned by the #contents method. Here, Array is returned,
since the abstract Stream-class has no idea of the underlying
collection class.
It is redefined in some subclasses - for example, to return String.

queries
o  isBinary
return true, if in binary mode. Always returns false here,
to make internalStreams protocol compatible with externalStreams.

o  isOpen
for compatibility with externalStream:
return true, if this stream is open.

o  isPositionable
return true, if the stream supports positioning (some do not).
Since this is an abstract class, false is returned here - just to make certain.

o  isPrinterStream
return true, if this is a printerStream.
Since this is an abstract class, false is returned here.

o  isReadable
return true, if reading is supported by the recevier.
This has to be redefined in concrete subclasses.

** This method raises an error - it must be redefined in concrete classes **

o  isStream
return true, if the receiver is some kind of Stream. Always return true here.

o  isTerminalStream

o  isWritable
return true, if writing is supported by the recevier.
This has to be redefined in concrete subclasses.

** This method raises an error - it must be redefined in concrete classes **

o  lineLength
return the lineLength which `looks good' when pretty printed
text is sent to this stream.
This has NO meaning whatsoever to regular streams;
however, it may be used as a layout hint for prettyprinting functions
- for compatibility with TextCollectors, which returns its views actual
line length, and allows the prettyprinter to wrap at that position.

o  lineNumber
return the current lineNumber if known

o  numberOfTerminalCols

o  numberOfTerminalLines

o  pageFormat
return the pageFormat - nil here.
This has NO meaning whatsoever to regular streams;
however, it has been added for protocol compatibility with printerStreams

o  terminalType

reading
o  next
return the next element of the stream
- we do not know here how to do it, it must be redefined in subclass

** This method raises an error - it must be redefined in concrete classes **

o  next: count
return the next count elements of the stream as aCollection,
which depends on the streams type - (see #contentsSpecies).

o  next: count into: aWriteStream
put the next count elements of the stream into aWriteStream

o  nextAvailable: count
return the next count elements of the stream as aCollection.
If the stream reaches the end before count elements have been read,
return what is available. (i.e. a shorter collection).
The type of collection is specified in #contentsSpecies.

o  nextMatchFor: anObject
read an element from the receiver, return true if it was equal to
the argument, anObject; false otherwise.

o  nextOrNil
like #next, this returns the next element, if available.
If nothing is available, this does never raise a read-beyond end signal.
Instead, nil is returned immediately.

o  skip: numberToSkip
skip numberToSkip objects, return the receiver

o  skipFor: anObject
skip all objects up-to and including anObject;
return the element after anObject.

o  skipLine
read the next line (characters up to newline) skip only;
return nil if EOF reached, self otherwise.
Not allowed in binary mode.

o  skipThrough: anObject
skip all objects up-to and including anObject.
Return the receiver if skip was successful,
otherwise (i.e. if not found) return nil and leave the stream positioned at the end.
The next read operation will return the element after anObject.

o  skipThroughAll: aCollection
skip for and through the sequence given by the argument, aCollection;
return nil if not found, the receiver otherwise.
On a successful match, the next read will return elements after aCollection;
if no match was found, the receiver will be positioned at the end.

o  through: anObject
read a collection of all objects up-to anObject and return these
elements, including anObject.
The next read operation will return the element after anObject.
If anObject is not encountered, all elements up to the end are read
and returned.
Compare this with #upTo: which also reads up to some object
and also positions behind it, but does not include it in the returned
value.

o  throughAll: aCollection
read & return a collection of all objects up-to and including
a subcollection given by aCollection.
(i.e. read until a ``substring'' is encountered.)
The next read operation will return the element after aCollection.
If aCollection is not encountered, all elements up to the end are read
and returned.

o  throughAny: aCollection
read & return a collection of all objects up-to and including
an element contained in aCollection.
(i.e. read until any from aCollection is encountered.)
If no such character is encountered, all elements up to the end are read
and returned.

o  upTo: anObject
read a collection of all objects up-to anObject and return these
elements, but excluding anObject.
The next read operation will return the element after anObject.
(i.e. anObject is considered a separator, which is skipped)
Similar to #through:, but the matching object is not included in the
returned collection.
If anObject is not encountered, all elements up to the end are read
and returned.
Compare this with #through: which also reads up to some object
and also positions behind it, but DOES include it in the returned
value.

o  upTo: anObject into: aStream
read a collection of all objects up-to anObject and append these
elements to aStream, but excluding anObject.
The next read operation will return the element after anObject.
(i.e. anObject is considered a separator, which is skipped)
Similar to #through:, but the matching object is not included in the returned collection.
If anObject is not encountered, all elements up to the end are read and returned.
Compare this with #through: which also reads up to some object
and also positions behind it, but DOES include it in the returned value.

o  upToAllExcluding: aCollection
read a collection of all objects up-to a element which is contained in
aCollection and return these elements, but excluding the matching one.
The next read operation will return the element after aCollection.
If no such element is encountered, all elements up to the end are read
and returned.
See also #throughAll: which also reads up to some object
and also positions behind it, but DOES include it in the returned
value.
See also #upToAll:, which returns the same, but leaves the
read pointer before the matched subcollection.

o  upToAny: aCollectionOfObjects
read a collection of all objects up-to a element which is contained in
aCollectionOfObjects and return these elements, but excluding the matching one.
The next read operation will return the element after anObject.
If no such element is encountered, all elements up to the end are read
and returned.
Compare this with #throughAll: which also reads up to some object
and also positions behind it, but DOES include it in the returned
value.

o  upToBeforeAny: aCollectionOfObjects
read a collection of all objects up-to a element which is contained in
aCollectionOfObjects and return these elements, but excluding the matching one.
The next read operation will return the matching element.
If no such element is encountered, all elements up to the end are read
and returned.
This returns the exact same as upToAny: would, but leaves the streams position so that
the next read returns the matching delimiter instead of skipping it.
Caveat: this is the one which should have been called upTo: in the first place;
however, it seems now too late for a change.

o  upToEnd
return a collection of the elements up-to the end.
Return an empty collection, if the stream-end is already at the end.

reading-strings
o  nextLine
return the characters upTo (but excluding) the next cr (carriage return)
character (i.e. read a single line of text).
Added for protocol compatibility with externalStreams.

stacked computing streams
o  collecting: aBlock
return a stacked computing stream, which reads elements from the receiver,
applies aBlock to each read element, and provides the results as elements to its reader.

o  selecting: aBlock
return a stacked computing stream, which reads elements from the receiver,
but only provides elements for which aBlock returns true to its reader.

testing
o  atEnd
return true if the end of the stream has been reached;
- we do not know here how to do it, it must be redefined in subclass

** This method raises an error - it must be redefined in concrete classes **

o  isEmpty
return true, if the contents of the stream is empty

** This method raises an error - it must be redefined in concrete classes **

o  notEmpty
return true, if the contents of the stream is not empty

visiting
o  acceptVisitor: aVisitor with: aParameter

waiting for I/O
o  readWait
suspend the current process, until the receiver
becomes ready for reading. If data is already available,
return immediate.
The other threads are not affected by the wait.

o  readWaitTimeoutMs: timeout
ST-80 compatibility

o  readWaitWithTimeout: seconds
suspend the current process, until the receiver
becomes ready for reading or a timeout (in seconds) expired.
If data is already available, return immediate.
With nil seconds, wait forever.
Return true if a timeout occured (i.e. false, if data is available).
The other threads are not affected by the wait.

o  readWaitWithTimeoutMs: millis
suspend the current process, until the receiver
becomes ready for reading or a timeout (in milliseconds) expired.
If data is already available, return immediate.
With nil millis, wait forever.
Return true if a timeout occured (i.e. false, if data is available).
The other threads are not affected by the wait.

o  readWriteWait
suspend the current process, until the receiver
becomes ready for writing or reading.
Return immediate if the receiver is already ready.
The other threads are not affected by the wait.

o  readWriteWaitWithTimeoutMs: millis

o  writeWait
suspend the current process, until the receiver
becomes ready for writing.
Return immediate if the receiver is already ready.
The other threads are not affected by the wait.

o  writeWaitTimeoutMs: timeout
ST-80 compatibility

o  writeWaitWithTimeout: timeout
suspend the current process, until the receiver
becomes ready for writing or a timeout (in seconds) expired.
Return true if a timeout occured (i.e. false, if data is available).
Return immediate if the receiver is already ready.
The other threads are not affected by the wait.

o  writeWaitWithTimeoutMs: millis

writing
o  commit
alias for flush -- ST80 compatibility

o  cr
append a carriage-return to the stream.
This is only allowed, if the receiver supports writing.

o  crTab
append a carriage-return followed by a tab to the stream.
Same as crtab for ST/X backward compatibility.
This is only allowed, if the receiver supports writing.

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  crlf
append a CR LF to the stream.
This is only allowed, if the receiver supports writing.

o  crtab
append a carriage-return followed by a tab to the stream.
This is only allowed, if the receiver supports writing.

o  crtab: n
append a carriage-return followed by n tabs to the stream.
This is only allowed, if the receiver supports writing.

o  endEntry
ignored here - for compatibility with Transcript

o  ff
append a form-feed (new-pagee) to the receiver-stream.
This is only allowed, if the receiver supports writing.

o  flush
write out all unbuffered data - ignored here, but added
to make internalStreams protocol compatible with externalStreams

o  next: count put: anObject
put the argument, anObject count times onto the receiver.
This is only allowed, if the receiver supports writing.

o  nextPut: anObject
put the argument, anObject onto the receiver
- we do not know here how to do it, it must be redefined in subclass

** This method raises an error - it must be redefined in concrete classes **

o  nextPutAll: aCollection
put all elements of the argument, aCollection onto the receiver.
This is only allowed, if the receiver supports writing.

o  nextPutAll: aCollection startingAt: first
append the elements starting with index to the end
of the argument, aCollection onto the receiver.
This is only allowed, if the receiver supports writing.

o  nextPutAll: aCollection startingAt: first to: last
append the elements with index from first to last
of the argument, aCollection onto the receiver.
This is only allowed, if the receiver supports writing.

o  nextPutAllText: aText
normal streams can not handle text/emphasis, so convert aText to the string

o  nextPutAllUnicode: aString
normal streams can not handle multi-byte characters, so convert them to utf8

o  nextPutAllUntranslated: aCollection
for compatibility with printStreams (putAll - as-is without escapes)

o  nextPutLine: aCollection
put all elements of the argument, aCollection onto the receiver,
and append a cr (carriage return).
This is only useful with character streams in textMode,
and only allowed, if the receiver supports writing.

o  nextPutUnicode: aCharacter
normal streams can not handle multi-byte characters, so convert them to utf8

o  print: anObject
append a printed representation of anObject to the receiver.
Same as 'anObject printOn:self'; Added for ST-80 compatibility.

o  show: something
append a printed representation of the argument to the stream.
This makes streams somewhat compatible to TextCollectors and
allows you to say:
Smalltalk at:#Transcript put:Stdout
or to use #show:/#showCR: with internal or external streams.

o  show: something with: arg
append a printed representation of the argument to the stream, expanding
the placeHolder %1 with the printString of arg.
This makes streams somewhat compatible to TextCollectors and
allows you to say:
Smalltalk at:#Transcript put:Stdout
or to use #show:/#showCR: with internal or external streams.

o  show: something with: arg1 with: arg2
append a printed representation of the argument to the stream, expanding
the placeHolders %1 and %2 with the printStrings of arg1 and arg2.
This makes streams somewhat compatible to TextCollectors and
allows you to say:
Smalltalk at:#Transcript put:Stdout
or to use #show:/#showCR: with internal or external streams.

o  show: something with: arg1 with: arg2 with: arg3
append a printed representation of the argument to the stream, expanding
the placeHolders %1,%2 and %3 with the printStrings of arg1, arg2 and arg3.
This makes streams somewhat compatible to TextCollectors and
allows you to say:
Smalltalk at:#Transcript put:Stdout
or to use #show:/#showCR: with internal or external streams.

o  showCR: aString
append a printed representation of the argument to the stream
and append a newline character.
This makes streams somewhat compatible to TextCollectors and
allows you to say:
Smalltalk at:#Transcript put:Stdout
or to use #show:/#showCR: with internal or external streams.

o  showCr: aString
append a printed representation of the argument to the stream
and append a newline character.
This is obsolete ST/X backward compatibility; use #showCR:

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  space
append a space character to the receiver.
This is only allowed, if the receiver supports writing.

o  spaces: count
append count space-characters to the receiver.
This is only allowed, if the receiver supports writing.

o  store: anObject
append a printed representation of anObject to the receiver,
from which the receiver can be reconstructed (i.e. its storeString).
Same as 'anObject storeOn:self'; Added for ST-80 compatibility.

o  sync
write out all unbuffered data - ignored here, but added
to make internalStreams protocol compatible with externalStreams

o  syncData
write out all unbuffered data - ignored here, but added
to make internalStreams protocol compatible with externalStreams

o  tab
append a tab-character to the stream.
This is only allowed, if the receiver supports writing.

o  tab: count
append count tab-characters to the receiver.
This is only allowed, if the receiver supports writing.

writing-chunks
o  nextChunkPut: aString
put aString as a chunk onto the receiver;
double all exclamation marks except within primitives and append a
single delimiting exclamation mark at the end.
This modification of the chunk format (not doubling exclas in primitive code)
was done to have primitive code more readable and easier be edited in the fileBrowser
or other editors.
Its no incompatibility, since inline primitives are an ST/X special
and code containing ST/X primitives cannot be loaded into other smalltalks anyway.

o  nextPutAllAsChunk: aString
put aString as a chunk onto the receiver;
double all exclamation marks except within primitives.
This modification of the chunk format (not doubling exclas in primitive code)
was done to have primitive code more readable and easier be edited in the fileBrowser
or other editors.
Its no incompatibility, since inline primitives are an ST/X special
and code containing ST/X primitives cannot be loaded into other smalltalks anyway.

o  nextPutChunkSeparator
append a chunk separator character



ST/X 6.1.1; WebServer 1.620 at exept:8081; Wed, 23 May 2012 21:13:43 GMT