boolean decode(final ByteBuffer buffer) {
            if (buffer == null || buffer.remaining() < HEADER_SIZE) {
                LOG.error("Fail to decode segment header, invalid buffer length: {}",
                    buffer == null ? 0 : buffer.remaining());
                return false;
            }
            if (buffer.get() != MAGIC) {
                LOG.error("Fail to decode segment header, invalid magic.");
                return false;
            }
            if (buffer.get() != MAGIC) {
                LOG.error("Fail to decode segment header, invalid magic.");
                return false;
            }
            this.firstLogIndex = buffer.getLong();
            return true;
        }
Segment file header.
@author boyan(boyan@antfin.com)
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/SegmentFile.java