private void truncateFile(final boolean sync) throws IOException {
        // Truncate dirty data.
        clear(this.wrotePos, sync);
        this.buffer.position(this.wrotePos);
        LOG.warn("Truncated segment file {} from pos={}.", this.path, this.wrotePos);
    }
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