[Pharo-project] Bug in FileSystem

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Jan 7 09:22:44 EST 2012


2012/1/7 Sven Van Caekenberghe <sven at beta9.be>:
>
> On 07 Jan 2012, at 14:19, Henrik Sperre Johansen wrote:
>
>> 1) There's no next: into: (which returns the amount read). It's really the only way to do buffers without garbage allocations.
>
> The 2 key methods for efficient IO are:
>
> readInto: collection startingAt: offset count: requestedCount
>        "Read requestedCount elements into collection starting at offset,
>        returning the number of elements read, there could be less elements available."
>
> next: count putAll: collection startingAt: offset
>        "Write count bytes from collection starting at offset."
>
> All other bulk operations can be written in terms of these (see for example Zodiac streams).
>
> Sven

+1.
All streams should provide these API, and if possible, provide an
optimized implementation.
It was not the case in Squeak, i started to refactor a bit, but
incrementally modifying this dinosaurus without creating circularities
is a sport!
I still have 3 years old refactorings unpublished because I'm not sure
how to reproduce the changes in a safe order ;)

Nicolas




More information about the Pharo-dev mailing list