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: number.
��� 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