MCPcopy Create free account
hub / github.com/brimdata/super / Serialize

Method Serialize

db/commits/object.go:94–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94func (o Object) Serialize() ([]byte, error) {
95 writer := bsupbytes.NewSerializer()
96 writer.Decorate(sup.StylePackage)
97 for _, action := range o.Actions {
98 if err := writer.Write(action); err != nil {
99 writer.Close()
100 return nil, err
101 }
102 }
103 if err := writer.Close(); err != nil {
104 return nil, err
105 }
106 b := writer.Bytes()
107 if len(b) == 0 {
108 return nil, ErrEmptyTransaction
109 }
110 return b, nil
111}
112
113func DecodeObject(r io.Reader) (*Object, error) {
114 o := &Object{}

Callers

nothing calls this directly

Calls 5

DecorateMethod · 0.95
WriteMethod · 0.95
CloseMethod · 0.95
BytesMethod · 0.95
NewSerializerFunction · 0.92

Tested by

no test coverage detected