def scan pattern, consume=false
rv = super# You'll notice that this next section is very similar to the same# section in match(), but just a liiittle different. This is# because it is a touch faster to do it this way with scan()# than the way match() does it; enough faster to warrent duplicating# some codeif rv.size == 0
until @buffer =~ pattern or @source.nil?
begin#str = @source.read(@block_size)
str = @source.readline('>')
str = encode(str) if str and @to_utf
@buffer << str
rescue
@source = nilendend
rv = superend
rv.taint
rv
end