aboutsummaryrefslogtreecommitdiffstats
path: root/formats/objfile/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'formats/objfile/reader.go')
-rw-r--r--formats/objfile/reader.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/formats/objfile/reader.go b/formats/objfile/reader.go
index 5b17da0..99ed754 100644
--- a/formats/objfile/reader.go
+++ b/formats/objfile/reader.go
@@ -121,3 +121,16 @@ func (r *Reader) Close() (err error) {
return
}
+
+// FillObject fills the given object from an object entry
+func (r *Reader) FillObject(obj core.Object) error {
+ obj.SetType(r.header.t)
+ obj.SetSize(r.header.size)
+ w, err := obj.Writer()
+ if err != nil {
+ return err
+ }
+ _, err = io.Copy(w, r.r)
+
+ return err
+}