code: private void ensure(int ahead) {
          int len = (end - p) + ahead;
          if (len >= bytes.length) {
              byte[]tmp = new byte[len + NODE_STR_MARGIN];
              System.arraycopy(bytes, p, tmp, 0, end - p);
              bytes = tmp;
          }
      }
docs: /* Ensure there is ahead bytes available in node's buffer
  (assumes that the node is not shared)