EncodedStream.st
author ca
Fri, 12 Mar 2004 10:15:58 +0100
changeset 8165 d6446fc1ea3b
parent 8148 dbf64e3142d9
child 8175 3548845d3c09
permissions -rw-r--r--
more stream protocol

"
 COPYRIGHT (c) 2004 by eXept Software AG
              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.
"

"{ Package: 'stx:libbasic' }"

Stream subclass:#EncodedStream
	instanceVariableNames:'encoder stream'
	classVariableNames:''
	poolDictionaries:''
	category:'Collections-Text-Encodings'
!

!EncodedStream class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2004 by eXept Software AG
              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.
"
! !

!EncodedStream class methodsFor:'instance creation'!

stream:streamArg encoder:encoder
    ^ (self basicNew) stream:streamArg; encoder:encoder
! !

!EncodedStream methodsFor:'accessing'!

encoder
    ^ encoder
!

encoder:something
    encoder := something.
!

stream
    ^ stream
!

stream:something
    stream := something.
! !

!EncodedStream methodsFor:'stream protocol'!

close
    stream close
!

nextChunk
    ^ encoder decodeString:(stream nextChunk)
!

nextPut:aCharacter
    self nextPutAll:(aCharacter asString).
!

nextPutAll:aCollection
    stream nextPutAll:(encoder encodeString:aCollection).
!

position
    ^ stream position
!

position1Based:newPosition
    stream position1Based:newPosition
! !

!EncodedStream class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.4 2004-03-12 09:15:58 ca Exp $'
! !