This class is a convenience class for wrappering InputStreams that are
used for ContextElements.
In order to support multiple audit providers reading the stream from the
beginning, the InputStream that is being wrappered must support Mark/Reset.
Also, the wrapper will handle reseting the stream to the beginning and will
represent the stream to the audit providers as not supporting mark/reset (to
prevent them from resetting the mark).
The readlimit passed into the constructor controls the maximum expected size
of the stream that is resetable (up to Integer.MAX_VALUE), data larger than
that is not guaranteed to be resetable (it is possible some InputStream
implementations will not invalidate the mark, but it should be assumed they
Note that different InputStream implementations may be very different in how
efficient they handle mark/reset, some may keep a buffer the size of the
readLimit in memory, etc... So it is wise to set a reasonable readLimit for
the expected size of the data handled by the wrappered stream.
The ContextElement class will callResetToStart() on the stream when a getValue()
is done that passes out a ContextElementMessageStream value.
The stream must be handed out and serially read by one thread at a time,
multiple threads cannot be handed out the stream and access it simultaneously.