- public void addStep(NextableInputStreamStep step) {
- steps.add(step);
- }
-
- public boolean next() {
- if (!hasMoreData() && step != null) {
+ /**
+ * Unblock the processing of the next sub-stream.
+ * <p>
+ * It can only be called when the "current" stream is spent (i.e., you must
+ * first process the stream until it is spent).
+ * <p>
+ * We consider that when the under-laying {@link InputStream} is also spent,
+ * we cannot have a next sub-stream (it will thus return FALSE).
+ * <p>
+ * {@link IOException}s can happen when we have no data available in the
+ * buffer; in that case, we fetch more data to know if we can have a next
+ * sub-stream or not.
+ *
+ * @return TRUE if we unblocked the next sub-stream, FALSE if not
+ *
+ * @throws IOException
+ * in case of I/O error
+ */
+ public boolean next() throws IOException {
+ if (!hasMoreData() && stopped) {