From 9cf66aeafbcbb9237fedc2efc97cc2856eb60f7f Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:56:29 -0700 Subject: Convert more bespoke methods to io.Reader/io.Writer interfaces --- hotline/file_wrapper.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hotline/file_wrapper.go') diff --git a/hotline/file_wrapper.go b/hotline/file_wrapper.go index 2c796ca..ec025dc 100644 --- a/hotline/file_wrapper.go +++ b/hotline/file_wrapper.go @@ -1,6 +1,7 @@ package hotline import ( + "bytes" "encoding/binary" "errors" "fmt" @@ -243,9 +244,11 @@ func (f *fileWrapper) flattenedFileObject() (*flattenedFileObject, error) { f.ffo.FlatFileHeader.ForkCount[1] = 3 - if err := f.ffo.FlatFileInformationFork.UnmarshalBinary(b); err != nil { + _, err = io.Copy(&f.ffo.FlatFileInformationFork, bytes.NewReader(b)) + if err != nil { return nil, err } + } else { f.ffo.FlatFileInformationFork = FlatFileInformationFork{ Platform: []byte("AMAC"), // TODO: Remove hardcode to support "AWIN" Platform (maybe?) -- cgit