summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deserialize.go10
-rw-r--r--serialize.go8
2 files changed, 13 insertions, 5 deletions
diff --git a/deserialize.go b/deserialize.go
index 579acac..73406aa 100644
--- a/deserialize.go
+++ b/deserialize.go
@@ -65,7 +65,11 @@ func Deserialize(r io.Reader, idNameMap map[string]mt.Content) *MapBlk {
panic(err)
}
- if _, err := io.Copy(io.Discard, r); err != nil {
+ if err := binary.Read(r, binary.BigEndian, &blk.Param1); err != nil {
+ panic(err)
+ }
+
+ if err := binary.Read(r, binary.BigEndian, &blk.Param2); err != nil {
panic(err)
}
@@ -149,10 +153,6 @@ func Deserialize(r io.Reader, idNameMap map[string]mt.Content) *MapBlk {
}
}
- if _, err := io.Copy(io.Discard, r); err != nil {
- panic(err)
- }
-
if err := r.Close(); err != nil {
panic(err)
}
diff --git a/serialize.go b/serialize.go
index 22c591f..ddfb72a 100644
--- a/serialize.go
+++ b/serialize.go
@@ -37,6 +37,14 @@ func Serialize(blk *MapBlk, w io.Writer, nameIdMap map[mt.Content]string) {
panic(err)
}
+ if err := binary.Write(zw, binary.BigEndian, &blk.Param1); err != nil {
+ panic(err)
+ }
+
+ if err := binary.Write(zw, binary.BigEndian, &blk.Param2); err != nil {
+ panic(err)
+ }
+
if err := zw.Close(); err != nil {
panic(err)
}