Issue 5721 in pharo: ZnChunkedReadStream misses some methods

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 5721 in pharo: ZnChunkedReadStream misses some methods

pharo
Status: Accepted
Owner: [hidden email]
Labels: Type-Bug Milestone-2.0

New issue 5721 by [hidden email]: ZnChunkedReadStream misses some  
methods
http://code.google.com/p/pharo/issues/detail?id=5721

ZnChunkedReadStream does not implement all methods from Stream. For example  
#contents is defined as subclassResponsibility in Stream and is not  
implemented in ZnChunkedReadStream. Still, instances of ZnChunkedStream are  
created by Zinc.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5721 in pharo: ZnChunkedReadStream misses some methods

pharo

Comment #1 on issue 5721 by [hidden email]: ZnChunkedReadStream  
misses some methods
http://code.google.com/p/pharo/issues/detail?id=5721

Can you be more specific about which methods are missing ?

ZnChunkedReadStream has a minimal implementation on purpose / by design.

Stream>>#contents does not make a lot of sense, in general ;-)

How can a stream access/return all its contents when you are halfway  
through reading ?
That assumes infinite buffering which is at conflict with streaming IMHO.

Maybe ZnChunkedReadStream should not subclass from Stream, or some methods  
should have a shouldNotImplement.

Are you trying to use this class for something else ?

Sven



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5721 in pharo: ZnChunkedReadStream misses some methods

pharo

Comment #2 on issue 5721 by [hidden email]: ZnChunkedReadStream  
misses some methods
http://code.google.com/p/pharo/issues/detail?id=5721

I was trying to find a string within the stream and my code didn't work. So  
I tried to get all the contents and #contents was not implemented. I think  
#contents makes sense for all streams, you just have to stream until the  
end and construct a collection of what you get. Sure, it's not efficient,  
but this is the responsibility of the programmer to decide when to be  
efficient.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5721 in pharo: ZnChunkedReadStream misses some methods

pharo

Comment #3 on issue 5721 by [hidden email]: ZnChunkedReadStream  
misses some methods
http://code.google.com/p/pharo/issues/detail?id=5721

There is #upToEnd, but that should not be the same as #contents

Note that SocketStream does also not have it (and the primary usage of  
ZnChunkedReadStream is to wrap an underlying SocketStream).

For, this is not a question of efficiency, but of semantics.

But I do agree that the current situation where #contents gives a subclass  
responsability is a problem.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5721 in pharo: ZnChunkedReadStream misses some methods

pharo
Updates:
        Status: Closed

Comment #4 on issue 5721 by [hidden email]: ZnChunkedReadStream  
misses some methods
http://code.google.com/p/pharo/issues/detail?id=5721

In the latest Zn update

http://code.google.com/p/pharo/issues/detail?id=6255

Can thus be closed


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker