|
|
Class: CharacterWriteStream
Object
|
+--Stream
|
+--PeekableStream
|
+--PositionableStream
|
+--WriteStream
|
+--CharacterWriteStream
|
+--TextStream
- Package:
- stx:libbasic
- Category:
- Streams
- Version:
- rev:
1.9
date: 2009/10/05 09:20:25
- user: cg
- file: CharacterWriteStream.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Stefan Vogel (stefan@zwerg)
This is a WriteStream, which automagically changes the underlying collection,
if a character does fit into the current collection.
String -> Unicode16String -> Unicode32Sting
[instance variables:]
[class variables:]
String
Unicode16String
Unicode32Sting
private
-
characterSizeChanged: aCharacterOrString
-
change aCollection to fit the size of aCharacter
private-accessing
-
on: aCollection
-
-
on: aCollection from: start to: stop
-
-
with: aCollection
-
writing
-
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.
-
nextPut: aCharacter
-
append the argument, aCharacter to the stream.
Specially tuned for appending to String, ByteArray and Array streams.
-
nextPutAll: aCollection
-
append aCollection to the receiver.
Redefined to convert to a string of the needed charcter size.
-
nextPutAll: aCollection startingAt: start to: stop
-
-
nextPutAllUnicode: aCollection
-
-
nextPutUnicode: aCharacter
-
|stream|
stream := CharacterWriteStream on:(String new:32).
stream nextPutAll:'abc'.
stream nextPut:(Character value:16r2c00).
stream contents inspect
|
|