An immutable window into a stream of character data.
An immutable window into a stream of character data. The size of the window
is determined by 2 methods: marked(pos) and append(chunk), which shrink
and expand the window respectively. All positions used with Input are
always relative to the entire stream, though only positions within the
current window are valid at any given point in time.
The method marked returns a new Input which may drop all data before the
marked position. Accessing data before the marked position in the returned
Input is undefined and should be expected to fail in hilarious ways.
The method append is used to append new chunks of data from the stream
onto the input. The Input returned by append will have all its data
up-to mark removed.
An immutable window into a stream of character data. The size of the window is determined by 2 methods:
marked(pos)
andappend(chunk)
, which shrink and expand the window respectively. All positions used withInput
are always relative to the entire stream, though only positions within the current window are valid at any given point in time.The method
marked
returns a newInput
which may drop all data before the marked position. Accessing data before the marked position in the returnedInput
is undefined and should be expected to fail in hilarious ways.The method
append
is used to append new chunks of data from the stream onto the input. TheInput
returned byappend
will have all its data up-tomark
removed.