import java.io.IOException;
import java.io.InputStream;
+import be.nikiroo.utils.streams.MarkableFileInputStream;
+
/**
* This class represents an image data.
*
* in case of I/O error
*/
public InputStream newInputStream() throws IOException {
- return new FileInputStream(data);
+ return new MarkableFileInputStream(new FileInputStream(data));
}
/**
while (hasMoreData() && done < blen) {
preRead();
if (hasMoreData()) {
- int now = Math.min(blen, stop) - start;
+ int now = Math.min(blen - done, stop - start);
if (now > 0) {
System.arraycopy(buffer, start, b, boff + done, now);
start += now;