Hi everyone,
I have a BufferedInputStream in my program and I want to use the whole stream multiple times, so I wrote my code like this:
BufferedInputStream bis = new BufferedInputStream(inputStream);
if (bis.markSupported()) {
bis.mark(bis.available());
}
However when I called bis.mark() afterwards, there was a java.io.IOException: Resetting to invalid mark which indicate that the mark had became invalid.
May I know why the Exception happened since I've already assigned the whole size of the stream to the readlimit parameter of the mark method?
Thanks!
Kit
I have a BufferedInputStream in my program and I want to use the whole stream multiple times, so I wrote my code like this:
BufferedInputStream bis = new BufferedInputStream(inputStream);
if (bis.markSupported()) {
bis.mark(bis.available());
}
However when I called bis.mark() afterwards, there was a java.io.IOException: Resetting to invalid mark which indicate that the mark had became invalid.
May I know why the Exception happened since I've already assigned the whole size of the stream to the readlimit parameter of the mark method?
Thanks!
Kit