private void readDataFromStream() {
        Future<Buffer> fetchResult = vertx.executeBlocking(() -> {
            try {
                byte[] data = in.readNBytes(bufferSize);
                return BufferImpl.buffer(Unpooled.wrappedBuffer(data));
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        });
        fetchResult.onSuccess(buf -> {
            if (queue.write(buf) && buf.length() > 0) {
                // load more data
                readDataFromStream();
            }
        }).onFailure(error -> {
            log.info("Failed to read data from InputStream", error);
            close();
            synchronized (InputStreamReader.this) {
                if (exceptionHandler != null) {
                    exceptionHandler.handle(error);
                }
            }
        });
    }
Implementation of vertx {@link io.vertx.core.streams.ReadStream} that wraps {@link java.io.InputStream}.
server/src/main/java/com/epam/aidial/core/server/vertx/stream/InputStreamReader.java