private void bufferJsonStruct(JsonParser parser, JsonToken firstToken) {
        JsonToken token = parser.currentToken();
        Preconditions.checkArgument(token == firstToken,
                                    "Expected %s, got %s.", firstToken.name(), token);
        updateNesting(token);

        try {
            for (int nesting = addFromParser(parser); nesting > 0; nesting += addFromParser(parser))
                parser.nextValue();
        }
        catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
    }
Returns a sequence of remaining tokens in this, or nulls when none remain.
This may fill the token buffer, but not otherwise modify it.
document/src/main/java/com/yahoo/document/json/TokenBuffer.java