8047
|
1 |
"{ Package: 'stx:libbasic' }"
|
|
2 |
|
|
3 |
Stream subclass:#EncodedStream
|
|
4 |
instanceVariableNames:'encoder stream'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Collections-Text-Encodings'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!EncodedStream class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
stream:streamArg encoder:encoder
|
|
14 |
^ (self basicNew) stream:streamArg; encoder:encoder
|
|
15 |
! !
|
|
16 |
|
|
17 |
!EncodedStream methodsFor:'accessing'!
|
|
18 |
|
|
19 |
encoder
|
|
20 |
^ encoder
|
|
21 |
!
|
|
22 |
|
|
23 |
encoder:something
|
|
24 |
encoder := something.
|
|
25 |
!
|
|
26 |
|
|
27 |
stream
|
|
28 |
^ stream
|
|
29 |
!
|
|
30 |
|
|
31 |
stream:something
|
|
32 |
stream := something.
|
|
33 |
! !
|
|
34 |
|
|
35 |
!EncodedStream methodsFor:'stream protocol'!
|
|
36 |
|
8147
|
37 |
nextChunk
|
|
38 |
^ encoder decodeString:(stream nextChunk)
|
|
39 |
!
|
|
40 |
|
8047
|
41 |
nextPut:aCharacter
|
|
42 |
self nextPutAll:(aCharacter asString).
|
|
43 |
!
|
|
44 |
|
|
45 |
nextPutAll:aCollection
|
|
46 |
stream nextPutAll:(encoder encodeString:aCollection).
|
8147
|
47 |
!
|
|
48 |
|
|
49 |
position1Based:newPosition
|
|
50 |
stream position1Based:newPosition
|
8047
|
51 |
! !
|
|
52 |
|
|
53 |
!EncodedStream class methodsFor:'documentation'!
|
|
54 |
|
|
55 |
version
|
8147
|
56 |
^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.2 2004-03-09 21:52:03 cg Exp $'
|
8047
|
57 |
! !
|