X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/a55350daaf83498b7a237c027ad0dd2377f06fee..a2ef262a164fc735b9b8471ac0c8001eea2b9bf6:/hotline/file_resume_data.go diff --git a/hotline/file_resume_data.go b/hotline/file_resume_data.go index f5b82de..b5d980e 100644 --- a/hotline/file_resume_data.go +++ b/hotline/file_resume_data.go @@ -12,6 +12,8 @@ type FileResumeData struct { RSVD [34]byte // Unused ForkCount [2]byte // Length of ForkInfoList. Either 2 or 3 depending on whether file has a resource fork ForkInfoList []ForkInfoList + + readOffset int } type ForkInfoList struct { @@ -40,6 +42,31 @@ func NewFileResumeData(list []ForkInfoList) *FileResumeData { } } +// +//func (frd *FileResumeData) Read(p []byte) (int, error) { +// buf := slices.Concat( +// frd.Format[:], +// frd.Version[:], +// frd.RSVD[:], +// frd.ForkCount[:], +// ) +// for _, fil := range frd.ForkInfoList { +// buf = append(buf, fil...) +// _ = binary.Write(&buf, binary.LittleEndian, fil) +// } +// +// var buf bytes.Buffer +// _ = binary.Write(&buf, binary.LittleEndian, frd.Format) +// _ = binary.Write(&buf, binary.LittleEndian, frd.Version) +// _ = binary.Write(&buf, binary.LittleEndian, frd.RSVD) +// _ = binary.Write(&buf, binary.LittleEndian, frd.ForkCount) +// for _, fil := range frd.ForkInfoList { +// _ = binary.Write(&buf, binary.LittleEndian, fil) +// } +// +// return buf.Bytes(), nil +//} + func (frd *FileResumeData) BinaryMarshal() ([]byte, error) { var buf bytes.Buffer _ = binary.Write(&buf, binary.LittleEndian, frd.Format)