+ for (int i = bbBuffers.size() - 1; i >= 0; i--) {
+ // DEBUG("pushback", bbBuffers.get(i), bbOffsets.get(i),
+ // bbLengths.get(i));
+ pushback(bbBuffers.get(i), bbOffsets.get(i), bbLengths.get(i));
+ }
+
+ return read;
+ }
+
+ // static public void DEBUG(String title, byte[] b, int off, int len) {
+ // String str = new String(b,off,len);
+ // if(str.length()>20) {
+ // str=str.substring(0,10)+" ...
+ // "+str.substring(str.length()-10,str.length());
+ // }
+ // }
+
+ @Override
+ public String toString() {
+ StringBuilder rep = new StringBuilder();
+ rep.append(getClass().getSimpleName()).append("\n");
+
+ for (int i = 0; i < froms.length; i++) {
+ byte[] from = froms[i];
+ byte[] to = tos[i];
+
+ rep.append("\t");
+ rep.append("bytes[").append(from.length).append("]");
+ if (from.length <= 20) {
+ rep.append(" (").append(new String(from)).append(")");
+ }
+ rep.append(" -> ");
+ rep.append("bytes[").append(to.length).append("]");
+ if (to.length <= 20) {
+ rep.append(" (").append(new String(to)).append(")");