aboutsummaryrefslogtreecommitdiff
path: root/hotline/file_resume_data.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-24 16:23:56 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-24 16:23:56 -0700
commita2ef262a164fc735b9b8471ac0c8001eea2b9bf6 (patch)
tree9a24fc5949df1183895a125e09cb262cdf79b073 /hotline/file_resume_data.go
parenta55350daaf83498b7a237c027ad0dd2377f06fee (diff)
Refactoring, cleanup, test backfilling
Diffstat (limited to 'hotline/file_resume_data.go')
-rw-r--r--hotline/file_resume_data.go27
1 files changed, 27 insertions, 0 deletions
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)