Factor out #upToPosition:, which lets us address the discrepancy between position counting bytes in MultiByteFileStream, but #next: expecting a count of items in #upToAll:. This is the first half of a fix for Mantis #4665. See also MultilingualTests-tonyg.22.
=============== Diff against Collections-topa.733 ===============
Item was changed:
----- Method: PositionableStream>>upToAll: (in category 'accessing') -----
"Answer a subcollection from the current access position to the occurrence (if any, but not inclusive) of aCollection. If aCollection is not in the stream, answer the entire rest of the stream."
Item was added:
+ ----- Method: PositionableStream>>upToPosition: (in category 'accessing') -----
+ upToPosition: anInteger
+ "Answer a subcollection containing items starting from the current position and ending including the given position. Usefully different to #next: in that in the case of MultiByteFileStream, and perhaps others, positions measure in terms of encoded items, while #next: convention is to name a number of items, independent of their encoding in the underlying buffer."
+ ^ self next: anInteger - position