java/driver/flight-sql/src/main/java/org/apache/arrow/adbc/driver/flightsql/RootArrowReader.java [32:74]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class RootArrowReader extends ArrowReader {
  private final Schema schema;
  private final List<ArrowRecordBatch> batches;
  int nextIndex;

  public RootArrowReader(BufferAllocator allocator, Schema schema, List<ArrowRecordBatch> batches) {
    super(allocator);
    this.schema = schema;
    this.batches = batches;
    this.nextIndex = 0;
  }

  public static ArrowReader fromRoot(BufferAllocator allocator, VectorSchemaRoot root) {
    final ArrowRecordBatch recordBatch = new VectorUnloader(root).getRecordBatch();
    return new RootArrowReader(allocator, root.getSchema(), Collections.singletonList(recordBatch));
  }

  @Override
  public boolean loadNextBatch() throws IOException {
    if (nextIndex < batches.size()) {
      new VectorLoader(getVectorSchemaRoot()).load(batches.get(nextIndex++));
      return true;
    }
    return false;
  }

  @Override
  public long bytesRead() {
    return 0;
  }

  @Override
  protected void closeReadSource() throws IOException {
    try {
      AutoCloseables.close(batches);
    } catch (Exception e) {
      throw new IOException(e);
    }
  }

  @Override
  protected Schema readSchema() {
    return schema;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/driver/jdbc/src/main/java/org/apache/arrow/adbc/driver/jdbc/RootArrowReader.java [32:74]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class RootArrowReader extends ArrowReader {
  private final Schema schema;
  private final List<ArrowRecordBatch> batches;
  int nextIndex;

  public RootArrowReader(BufferAllocator allocator, Schema schema, List<ArrowRecordBatch> batches) {
    super(allocator);
    this.schema = schema;
    this.batches = batches;
    this.nextIndex = 0;
  }

  public static ArrowReader fromRoot(BufferAllocator allocator, VectorSchemaRoot root) {
    final ArrowRecordBatch recordBatch = new VectorUnloader(root).getRecordBatch();
    return new RootArrowReader(allocator, root.getSchema(), Collections.singletonList(recordBatch));
  }

  @Override
  public boolean loadNextBatch() throws IOException {
    if (nextIndex < batches.size()) {
      new VectorLoader(getVectorSchemaRoot()).load(batches.get(nextIndex++));
      return true;
    }
    return false;
  }

  @Override
  public long bytesRead() {
    return 0;
  }

  @Override
  protected void closeReadSource() throws IOException {
    try {
      AutoCloseables.close(batches);
    } catch (Exception e) {
      throw new IOException(e);
    }
  }

  @Override
  protected Schema readSchema() {
    return schema;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



