return next(true);
}
+ /**
+ * Check if this stream is totally spent (no more data to read or to
+ * process).
+ * <p>
+ * Note: an empty stream that is still not started will return FALSE, as we
+ * don't know yet if it is empty.
+ *
+ * @return TRUE if it is
+ */
+ @Override
+ public boolean eof() {
+ return super.eof();
+ }
+
/**
* Check if we still have some data in the buffer and, if not, fetch some.
*
return bufferChanged;
}
- if (pos >= len) {
+ if (start >= stop) {
eof = true;
}
/**
* Check that the buffer didn't overshot to the next item, and fix
- * {@link NextableInputStream#len} if needed.
+ * {@link NextableInputStream#stop} if needed.
* <p>
- * If {@link NextableInputStream#len} is fixed,
+ * If {@link NextableInputStream#stop} is fixed,
* {@link NextableInputStream#eof} and {@link NextableInputStream#stopped}
* are set to TRUE.
*
* the {@link NextableInputStreamStep}
*/
private void checkBuffer(boolean newBuffer) {
- if (step != null && len > 0) {
+ if (step != null && stop > 0) {
if (newBuffer) {
step.clearBuffer();
}
- int stopAt = step.stop(buffer, pos, len);
+ int stopAt = step.stop(buffer, start, stop);
if (stopAt >= 0) {
- len = stopAt;
+ stop = stopAt;
eof = true;
stopped = true;
}
}
if (step != null && !hasMoreData() && stopped) {
- len = step.getResumeLen();
- pos += step.getResumeSkip();
+ stop = step.getResumeLen();
+ start += step.getResumeSkip();
eof = false;
if (all) {