private void expand() {
            int newSize = size * 2;
            if (newSize <= size)
                throw new IllegalStateException("Maximum buffer size exceeded; want to double " + size + ", but that's too much");

            byte[] newData = new byte[newSize];
            int offset = (int) (tail % size);
            int newOffset = (int) (tail % newSize);
            int toWrite = size - offset;
            // exactly doubling the buffer size ensures there is room in the new buffer
            System.arraycopy(data, offset, newData, newOffset, toWrite);
            // the wrapped data ends up either after the first part, or at the start of the new buffer
            newOffset = (newOffset + toWrite) % newSize;
            System.arraycopy(data, 0, newData, newOffset, offset);
            size = newSize;
            data = newData;
            lock.notify();
        }
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