boolean mmapFile(final boolean create) {
        if (this.buffer != null) {
            return true;
        }
        final File file = new File(this.path);

        if (file.exists()) {
            this.size = (int) file.length();
        } else {
            if (!create) {
                LOG.error("File {} is not exists.", this.path);
                return false;
            }
        }
        try (FileChannel fc = openFileChannel(create)) {
            this.buffer = fc.map(MapMode.READ_WRITE, 0, this.size);
            this.buffer.limit(this.size);
            if (!loadHeader()) {
                LOG.error("Fail to load segment header from file {}.", this.path);
                return false;
            }
            return true;
        } catch (final IOException e) {
            LOG.error("Fail to mmap segment file {}.", this.path, e);
            return false;
        }
    }
Clear data in [startPos, startPos+64).

@param startPos the start position(inclusive)
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/SegmentFile.java