+
+ // // consider that if EOF, there is no next
+ // if (start >= stop) {
+ // // Make sure, block if necessary
+ // preRead();
+ //
+ // return hasMoreData();
+ // }
+ //
+ // return true;
+ }
+
+ /**
+ * Display a DEBUG {@link String} representation of this object.
+ * <p>
+ * Do <b>not</b> use for release code.
+ */
+ @Override
+ public String toString() {
+ String data = "";
+ if (stop > 0) {
+ try {
+ data = new String(Arrays.copyOfRange(buffer, 0, stop), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ }
+ if (data.length() > 200) {
+ data = data.substring(0, 197) + "...";
+ }
+ }
+ String rep = String.format(
+ "Nextable %s: %d -> %d [eof: %s] [more data: %s]: %s",
+ (stopped ? "stopped" : "running"), start, stop, "" + eof, ""
+ + hasMoreData(), data);
+
+ return rep;