private static void put(final MappedByteBuffer buffer, final int index, final byte[] data) {
        for (int i = 0; i < data.length; i++) {
            buffer.put(index + i, data[i]);
        }
    }
Write the data and return it's wrote position.

@param logIndex the log index
@param data     data to write
@return the wrote position
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/SegmentFile.java