func (p *PackIndex) MarshalBinary() []byte {
	b := make([]byte, 0)
	b = append(b, p.Sum[:]...)
	b = append(b, uint64Binary(p.Size)...)
	b = append(b, uint64Binary(uint64(len(p.Blocks)))...)
	for _, bck := range p.Blocks {
		b = bck.marshalBinary(b)
	}
	return b
}
MarshalBinary converts a PackIndex to its binary representation.
package object
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"io"
	"github.com/jotfs/jotfs/internal/compress"
	"github.com/jotfs/jotfs/internal/sum"
)
const maxBlocks = 10_000
type BlockInfo struct {
	Sum sum.Sum
	ChunkSize uint64
	Sequence uint64
	Offset uint64
	Size uint64
	Mode compress.Mode
}
type PackIndex struct {
	Blocks []BlockInfo
	Sum sum.Sum
	Size uint64
}