Is there a way to use Matcher on a stream of unknown length?
I've seen some examples using streams, but they either expect the
regular expression to be limited to matching lines, or the stream is
from a file where the complete length is known.
If I subclass CharSequence I need to know the entire length, so that's
out... Any ideas?
VisionSet - 02 Sep 2006 22:28 GMT
> Is there a way to use Matcher on a stream of unknown length?
>
[quoted text clipped - 4 lines]
> If I subclass CharSequence I need to know the entire length, so that's
> out... Any ideas?
I think the only possible solution would be to buffer the input and cache
the reg exps until they can be ruled out for sure. Each reg exp could be
paired with a pointer into the stream and the buffer can be flushed to the
point of the last cached pointer.
--
Mike W