As mentioned in https://github.com/elastic/elasticsearch/pull/96216, `LuceneVerifyingIndexOutput` always copies the last chunk byte-by-byte. This might be a pretty big chunk. We should be able to copy all the bytes up to the start of the checksum in bulk (and then I guess bulk-copy the checksum too not that this matters so much).

In the same area, `LuceneVerifyingIndexOutput` is the only subclass of `VerifyingIndexOutput` and there's no need for it to be an inner class of `Store`. `VerifyingIndexInput` also doesn't need to be an inner class.
server/src/main/java/org/elasticsearch/index/store/VerifyingIndexOutput.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.index.store;
import org.apache.lucene.store.IndexOutput;
import org.elasticsearch.common.lucene.store.FilterIndexOutput;
import java.io.IOException;
/**
 * abstract class for verifying what was written.
 * subclasses override {@link #writeByte(byte)} and {@link #writeBytes(byte[], int, int)}
 */
public abstract class VerifyingIndexOutput extends FilterIndexOutput {
    
    VerifyingIndexOutput(IndexOutput out) {
        super("VerifyingIndexOutput(out=" + out.toString() + ")", out);
    }
    /**
     * Verifies the checksum and compares the written length with the expected file length. This method should be
     * called after all data has been written to this output.
     */
    public abstract void verify() throws IOException;
}