func (f *File) MarshalBinary() []byte {
	var vtag uint8
	if f.Versioned {
		vtag = 1
	}
	b := make([]byte, 0)
	b = append(b, uint64Binary(uint64(len(f.Name)))...)
	b = append(b, []byte(f.Name)...)
	b = append(b, uint64Binary(uint64(f.CreatedAt.UnixNano()))...)
	b = append(b, vtag)
	b = append(b, uint64Binary(uint64(len(f.Chunks)))...)
	buf := make([]byte, 0)
	for _, c := range f.Chunks {
		buf = c.marshalBinary(buf)
		b = append(b, buf...)
		buf = buf[:0]
	}
	return b
}
MarshalBinary writes the binary representation of a file to a writer.
package object
import (
	"encoding/binary"
	"fmt"
	"io"
	"time"
	"github.com/jotfs/jotfs/internal/sum"
)
const maxChunks = 1000000
const maxNameSize = 32768
type File struct {
	Name      string
	CreatedAt time.Time
	Chunks    []Chunk
	Versioned bool
}
type Chunk struct {
	Sequence uint64
	Size     uint64
	Sum      sum.Sum
}