[Pharo-project] Bug in FileSystem

Mariano Martinez Peck marianopeck at gmail.com
Sun Jan 8 08:39:09 EST 2012

>>  As for the API:
> 1) There's no next: into: (which returns the amount read). It's really the
> only way to do buffers without garbage allocations.

Hi Henry. One of the extensions I needed to add to FSReadStream in order to
make it work with Fuel was exatly #next:into:
The method is:

next: number into: aCollection
    | count |
    count := handle at: position read: aCollection startingAt: 1 count:
    position := position + count.
     ^ count < aCollection size
        ifTrue: [aCollection first: count]
        ifFalse: [aCollection]

I didn't understand what you meant by "It's really the only way to do
buffers without garbage allocations"
So...should I integrate this method #next:into: as it is together to the
fix to #read:

> 2) FSHandle >>at: offset read: buffer startingAt: start count: count is a
> weirdly named selector for what it does imho...
> Doesn't #at: offset read: count into: buffer startingAt: start  make more
> sense?
> Cheers,
> Henry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120108/0ff8d373/attachment-0001.html>

More information about the Pharo-dev mailing list