eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'CharacterWriteStream':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: CharacterWriteStream


Inheritance:

   Object
   |
   +--Stream
      |
      +--PeekableStream
         |
         +--PositionableStream
            |
            +--WriteStream
               |
               +--CharacterWriteStream
                  |
                  +--TextStream

Package:
stx:libbasic
Category:
Streams
Version:
rev: 1.24 date: 2018/04/14 06:07:03
user: cg
file: CharacterWriteStream.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Stefan Vogel (stefan@zwerg)

Description:


This is a WriteStream, which automagically changes the underlying collection,
if a character does not fit into the current collection 
(i.e. String -> Unicode16String -> Unicode32Sting )


[instance variables:]

[class variables:]


Related information:

    String
    Unicode16String
    Unicode32Sting

Class protocol:

instance creation
o  new
I know, that I operate on strings

o  new: count
I know, that I operate on strings


Instance protocol:

accessing
o  reset
reset the stream, to write again over the existing (or already written) contents.
See the comment in WriteStream>>contents

private
o  characterSizeChangedTo: newCharacterSize size: additionalSize
change aCollection to fit the size of newCharacterSize

private-accessing
o  on: aCollection
return a stream for writing into aCollection

o  on: aCollection from: start to: stop
return a stream for writing into part of aCollection.
This will position the stream to start writing at start-index,
and setup a writeLimit at stop-index.
Contents after stop-index will not be overwritten.

o  with: aCollection
return a stream for writing into aCollection.
This will position the stream to the end, and append written elements
after the initial contents.
I.e. the effect is similar to creating an empty stream first and then write
aCollection.

writing
o  next: count put: aCharacter
append anObject count times to the receiver.
Redefined to avoid count grows of the underlying collection -
instead a single grow on the final size is performed.

o  nextPut: aCharacter
append the argument, aCharacter to the stream.
Specially tuned for appending to String, Unicode16String and Unicode32String streams.

o  nextPutAll: aCollection
append aCollection to the receiver.
Redefined to convert to a string of the needed character size.

o  nextPutAll: aCollection startingAt: start to: stop

o  nextPutAllUnicode: aCollection

o  nextPutUnicode: aCharacter


Examples:


    |stream|

    stream := CharacterWriteStream on:(String new:32).
    stream nextPutAll:'abc'.
    stream nextPut:(Character value:16r2c00).
    stream contents inspect


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Sat, 22 Sep 2018 06:46:39 GMT