Marks a position in the stream to be returned to by a subsequent call to
reset
. Unlike a standard
InputStream
, all
ImageInputStream
s support marking. Additionally, calls to
mark
and
reset
may be nested arbitrarily.
Unlike the mark
methods declared by the Reader
and InputStream
interfaces, no readLimit
parameter is used. An arbitrary amount of data may be read following the call to mark
.
The bit position used by the readBits
method is saved and restored by each pair of calls to mark
and reset
.
Note that it is valid for an ImageReader
to call flushBefore
as part of a read operation. Therefore, if an application calls mark
prior to passing that stream to an ImageReader
, the application should not assume that the marked position will remain valid after the read operation has completed.