Can be used with any InputStream to restrict what is
read from it to stop before a particular regex match.
The regex must have a finite maximum length match string.
This can be used to forcibly stop consumption of data from a stream at
a length obtained from a delimiter that is described using a regex.
The delimiter matching the regex is consumed from the underlying stream (if found), and
the underlying stream is left positioned at the byte after the regex match
string.
IMPORTANT: The delimiter regex cannot contain any Capturing Groups!
Use (?: ... ) which is non-capturing, instead of regular ( ... ).
For example: this regex matches CRLF not followed by tab or space:
"""\r\n(?!(?:\t|\ ))"""
Notice use of the ?: to avoid a capture group around the alternatives of tab or space.
Thread safety: This is inherently stateful - so not thread safe to use
this object from more than one thread.
Linear Supertypes
InputStream, Closeable, AutoCloseable, AnyRef, Any
Can be used with any InputStream to restrict what is read from it to stop before a particular regex match.
The regex must have a finite maximum length match string.
This can be used to forcibly stop consumption of data from a stream at a length obtained from a delimiter that is described using a regex.
The delimiter matching the regex is consumed from the underlying stream (if found), and the underlying stream is left positioned at the byte after the regex match string.
IMPORTANT: The delimiter regex cannot contain any Capturing Groups! Use (?: ... ) which is non-capturing, instead of regular ( ... ). For example: this regex matches CRLF not followed by tab or space:
Notice use of the ?: to avoid a capture group around the alternatives of tab or space.
Thread safety: This is inherently stateful - so not thread safe to use this object from more than one thread.