1
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1989/90/91 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
WriteStream subclass:#ReadWriteStream
|
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Streams'
|
|
18 |
!
|
|
19 |
|
|
20 |
ReadWriteStream comment:'
|
|
21 |
|
|
22 |
COPYRIGHT (c) 1989/90/91 by Claus Gittinger
|
|
23 |
All Rights Reserved
|
|
24 |
|
|
25 |
@(#)RWStream.st 2.3 92/06/06
|
|
26 |
'!
|
|
27 |
|
|
28 |
!ReadWriteStream methodsFor: 'access-reading'!
|
|
29 |
|
|
30 |
peek
|
|
31 |
(position > readLimit) ifTrue: [ ^ nil ].
|
|
32 |
^ collection at:position
|
|
33 |
!
|
|
34 |
|
|
35 |
next
|
|
36 |
|p|
|
|
37 |
(position > readLimit) ifTrue: [ ^ nil ].
|
|
38 |
p := position.
|
|
39 |
position := position + 1.
|
|
40 |
^ collection at:p
|
|
41 |
! !
|