ReadWriteStream.st
author claus
Sun, 09 Jan 1994 22:25:58 +0100
changeset 41 a14247b04d03
parent 5 67342904af11
child 88 81dacba7a63a
permissions -rw-r--r--
*** empty log message ***

"
 COPYRIGHT (c) 1989 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

WriteStream subclass:#ReadWriteStream
       instanceVariableNames:''
       classVariableNames:''
       poolDictionaries:''
       category:'Streams'
!

ReadWriteStream comment:'

COPYRIGHT (c) 1989 by Claus Gittinger
              All Rights Reserved

$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.5 1994-01-09 21:23:34 claus Exp $
'!

!ReadWriteStream methodsFor: 'access-reading'!

peek
    "return the element to be read next without advancing read position.
     If there are no more elements, nil is returned."

    (position > readLimit) ifTrue:[^ nil].
    ^ collection at:position
!

next
    "return the next element; advance read position.
     If there are no more elements, nil is returned."

    |element|

    (position > readLimit) ifTrue:[^ nil].
    element := collection at:position.
    position := position + 1.
    ^ element
! !