Re: [Pharo-dev] ZnBufferedReadStream and #upToAll:

2019-03-18 Thread Eric Gade
Hi Sven, I am really curious why you need it ? > This came up for me when I was trying to parse out pieces of a PDF file. As you likely know, the PDF format has both text and binary information encoded within it. I had used #upToAll: in the past to find sequences of "magic bytes" that don't occur

Re: [Pharo-dev] ZnBufferedReadStream and #upToAll:

2019-03-18 Thread Stephan Eggermont
ducasse wrote: > > I imagine that sven did not add it because on infinite stream it does not > make sense. > Now it would be good to see how we can have useful extensions. But I let this > to sven. That sounds like something that would be useful to make explicit: isInfinite, with blocking, r

Re: [Pharo-dev] ZnBufferedReadStream and #upToAll:

2019-03-17 Thread ducasse
> On 17 Mar 2019, at 18:28, Benoit St-Jean wrote: > > If that was the case, then it makes no sense to implement #upTo: but not > #upToAll: , right Indeed :) > > On 2019-03-17 10:37, ducasse wrote: >> Was there a conscious decision not to include the #upToAll: method >> onZnBufferedRe

Re: [Pharo-dev] ZnBufferedReadStream and #upToAll:

2019-03-17 Thread Benoit St-Jean via Pharo-dev
--- Begin Message --- If that was the case, then it makes no sense to implement #upTo: but not #upToAll: , right On 2019-03-17 10:37, ducasse wrote: Was there a conscious decision not to include the #upToAll: method onZnBufferedReadStream?. This method is really useful for parsing files -

Re: [Pharo-dev] ZnBufferedReadStream and #upToAll:

2019-03-17 Thread Sven Van Caekenberghe
Eric, Someone wrote a clean implementation of #upToAll: that does not use #position: - I forgot who - but it can be found in ZnCharacterReadStream>>#upToAll: I guess this could be copied over to ZnBufferedReadStream. The main reason that I was against #upToAll: was the implementation using #po

Re: [Pharo-dev] ZnBufferedReadStream and #upToAll:

2019-03-17 Thread Eric Gade
Thanks Stef, I imagine that sven did not add it because on infinite stream it does not > make sense. > Just to clarify my earlier email, I got here was by calling `'/path/to/some/file' asFileReference binaryReadStream` which responds with the ZnBufferedReadStream. I expected to be able to use som

Re: [Pharo-dev] ZnBufferedReadStream and #upToAll:

2019-03-17 Thread ducasse
Hi eric > Hi all, > > Was there a conscious decision not to include the #upToAll: method > onZnBufferedReadStream?. This method is really useful for parsing files -- > finding sub-patterns of bytes, etc. Perhaps #upToAll: is not the idiomatic > way to do this, but I found it very useful to use