- long dataPos = out.getFilePointer();
- out.seek(tocPos);
- out.writeLong(dataPos);
- tocPos += 8;
- out.seek(dataPos);
- out.writeUTF(e.token);
- out.writeInt(e.startRow);
- out.writeInt(e.numRows);
+ tocout.writeLong(dataPos + outb.size());
+
+ outb.writeUTF(e.token);
+
+ int startRow = e.startRow;
+ int numRows = e.numRows;
+ if (prunedRowIdx != null) {
+ // note: the start row will always be a TokenRow
+ // and thus never be pruned
+ int newNumRows = 1;
+ for (int i = 1; i < numRows; i++) {
+ if (prunedRowIdx[startRow + i] >= 0) newNumRows++;
+ }
+ startRow = prunedRowIdx[startRow];
+ numRows = newNumRows;
+ }
+
+ outb.writeInt(startRow);
+ outb.writeInt(numRows);