CompletableFuture<Result> next() throws IOException {
            JsonToken token = parser.nextToken();
            if (multipleOperations && ! arrayPrefixParsed && token == JsonToken.START_ARRAY) {
                arrayPrefixParsed = true;
                token = parser.nextToken();
            }
            if (token == JsonToken.END_ARRAY && multipleOperations) return null;
            else if (token == null && ! arrayPrefixParsed) return null;
            else if (token != JsonToken.START_OBJECT) throw parseException("Unexpected token '" + parser.currentToken() + "'");
            long start = 0, end = -1;
            OperationType type = null;
            DocumentId id = null;
            OperationParameters parameters = protoParameters;
            loop: while (true) {
                switch (parser.nextToken()) {
                    case FIELD_NAME:
                        switch (parser.getText()) {
                            case "id":
                            case "put":    type = PUT;    id = readId(); break;
                            case "update": type = UPDATE; id = readId(); break;
                            case "remove": type = REMOVE; id = readId(); break;
                            case "condition": parameters = parameters.testAndSetCondition(readString()); break;
                            case "create":    parameters = parameters.createIfNonExistent(readBoolean()); break;
                            case "fields": {
                                expect(START_OBJECT);
                                start = parser.currentTokenLocation().getByteOffset();
                                int depth = 1;
                                while (depth > 0) switch (parser.nextToken()) {
                                    case START_OBJECT: ++depth; break;
                                    case END_OBJECT:   --depth; break;
                                }
                                end = parser.currentTokenLocation().getByteOffset() + 1;
                                break;
                            }
                            default: throw parseException("Unexpected field name '" + parser.getText() + "'");
                        }
                        break;

                    case END_OBJECT:
                        break loop;

                    default:
                        throw parseException("Unexpected token '" + parser.currentToken() + "'");
                }
            }
            if (id == null)
                throw parseException("No document id for document");
            if (type == REMOVE) {
                if (end >= start)
                    throw parseException("Illegal 'fields' object for remove operation");
                else
                    start = end = parser.currentTokenLocation().getByteOffset(); // getDocumentJson advances buffer overwrite head.
            }
            else if (end < start)
                throw parseException("No 'fields' object for document");

            String payload = getDocumentJson(start, end);
            switch (type) {
                case PUT:    return client.put   (id, payload, parameters);
                case UPDATE: return client.update(id, payload, parameters);
                case REMOVE: return client.remove(id, parameters);
                default: throw new OperationParseException("Unexpected operation type '" + type + "'");
            }
        }
Same as {@link #feedMany(InputStream, ResultCallback)}, but without a provided {@link ResultCallback} instance.
@see JsonFeeder#feedMany(InputStream, ResultCallback) for details.
vespa-feed-client-api/src/main/java/ai/vespa/feed/client/JsonFeeder.java