private int write(ByteBuffer src, long position) throws IOException {
        int bytesWritten = 0;
        while (src.hasRemaining()) {
            int written = fileChannel.write(src, position + bytesWritten);
            if (written == -1) {
                throw new IOException("write -1");
            }
            bytesWritten += written;
        }
        return bytesWritten;
    }
When set to true, the file should exist and the file size does not need to be verified.
s3stream/src/main/java/com/automq/stream/s3/wal/util/WALFileChannel.java