'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 30 September 2008 at 11:04:12 am'!

!PositionableStream methodsFor: 'accessing' stamp: 'jmv 9/30/2008 10:47'!
crLfNextLine
	"Answer next line (may be empty), or nil if at end.
	Support any line ending character or pair of them"

	| answer lineSeparators |
	self atEnd ifTrue: [^nil].
	lineSeparators _ {Character cr. Character lf}.
	answer _ self upToAny: lineSeparators.
	(lineSeparators includes: self peek) ifTrue: [
		self next ].
	^answer! !

!PositionableStream methodsFor: 'accessing' stamp: 'jmv 9/30/2008 10:43'!
upToAny: aCollection 
	"Similar to upTo:, but find any of the objects in aCollection"
	| newStream element |
	newStream _ WriteStream on: (collection species new: 100).
	[self atEnd or: [aCollection includes: (element _ self next)]]
		whileFalse: [newStream nextPut: element].
	^newStream contents! !


!StandardFileStream methodsFor: 'read, write, position' stamp: 'jmv 9/30/2008 11:02'!
upToAny: aCollection 
	"Similar to upTo:, but find any of the objects in aCollection"
	| newStream element |
	newStream _ WriteStream on: (buffer1 species new: 100).
	[self atEnd or: [aCollection includes: (element _ self next)]]
		whileFalse: [newStream nextPut: element].
	^newStream contents! !

