From a2ef262a164fc735b9b8471ac0c8001eea2b9bf6 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:23:56 -0700 Subject: Refactoring, cleanup, test backfilling --- hotline/file_resume_data.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to '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) -- cgit