private void fill() {
            try {
                while (true) {
                    int free;
                    synchronized (lock) {
                        while ((free = (int) (tail + size - head)) <= 0 && ! done)
                            lock.wait();
                    }
                    if (done) break;

                    int off = (int) (head % size);
                    int len = min(min(free, size - off), 1 << 13);
                    int read = in.read(data, off, len);

                    synchronized (lock) {
                        if (read < 0) done = true;
                        else head += read;
                        lock.notify();
                    }
                }
            } catch (InterruptedException e) {
                synchronized (lock) {
                    done = true;
                    thrown = new InterruptedIOException("Interrupted reading data: " + e.getMessage());
                }
            } catch (IOException e) {
                synchronized (lock) {
                    done = true;
                    thrown = e;
                }
            }
        }
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