code: private final void push() {
      if (ptr >= stack.length) {
        // doubling here is probably overkill, but anything that needs to double more than
        // once (32 levels deep) is very atypical anyway.
        byte[] newstack = new byte[stack.length<<1];
        System.arraycopy(stack,0,newstack,0,stack.length);
        stack = newstack;
      }
      stack[ptr++] = state;
    }
docs: push current parser state (use at start of new container)