public void fillEmptyBytesInFileEnd() {
        this.writeLock.lock();
        try {
            final int wrotePosition = getWrotePosition();
            final ByteBuffer byteBuffer = sliceByteBuffer();
            for (int i = wrotePosition; i < this.fileSize; i++) {
                byteBuffer.put(i, FILE_END_BYTE);
            }
            setWrotePosition(this.fileSize);
        } finally {
            this.writeLock.unlock();
        }
    }
Fill empty bytes in this file end when this fill has no sufficient free space to store one message
jraft-extension/java-log-storage-impl/src/main/java/com/alipay/sofa/jraft/storage/file/AbstractFile.java