File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package client
3
3
import (
4
4
"fmt"
5
5
"math"
6
+ "reflect"
6
7
)
7
8
8
9
var (
@@ -18,8 +19,8 @@ type collationbody []byte
18
19
19
20
type body interface {
20
21
length () int64
21
- validateblob () error
22
- ParseBlob ()
22
+ validateBody () error
23
+ serializeBlob () [] byte
23
24
}
24
25
25
26
func (cb collationbody ) length () int64 {
@@ -44,6 +45,24 @@ func (cb collationbody) validateBody() error {
44
45
return nil
45
46
}
46
47
48
+ func deserializeBlob (blob body ) []byte {
49
+ deserializedblob := blob .(collationbody )
50
+ length := deserializedblob .length ()
51
+ chunksNumber := chunkSize / length
52
+ indicatorByte := make ([]byte , 1 )
53
+ indicatorByte [0 ] = 0
54
+ tempbody := []byte {0 }
55
+
56
+ for i := int64 (1 ); i <= chunksNumber ; i ++ {
57
+
58
+ if reflect .TypeOf (deserializedblob [:(i - 1 )* chunksNumber ]) == reflect .TypeOf (indicatorByte ) {
59
+
60
+ }
61
+
62
+ }
63
+
64
+ }
65
+
47
66
// Parse Collation body and modify it accordingly
48
67
49
68
func (cb collationbody ) serializeBlob () []byte {
@@ -52,7 +71,7 @@ func (cb collationbody) serializeBlob() []byte {
52
71
chunksNumber := cb .length () / chunkDataSize
53
72
indicatorByte := make ([]byte , 1 )
54
73
indicatorByte [0 ] = 0
55
- var tempbody []byte
74
+ tempbody := []byte {}
56
75
57
76
// if blob is less than 31 bytes, it adds the indicator chunk and pads the remaining empty bytes to the right
58
77
You can’t perform that action at this time.
0 commit comments