MCPcopy Create free account
hub / github.com/egonelbre/exp / EncodeTree

Function EncodeTree

ber/tree.go:55–61  ·  view source on GitHub ↗
(tree *Tree)

Source from the content-addressed store, hash-verified

53}
54
55func EncodeTree(tree *Tree) ([]byte, error) {
56 var out bytes.Buffer
57 f := newForkableWriter()
58 writeTree(f, tree)
59 f.writeTo(&out)
60 return out.Bytes(), nil
61}
62
63func DecodeTree(data []byte) (*Tree, error) {
64 d := NewDecoder(bytes.NewReader(data))

Callers 2

UnmarshalMethod · 0.70
UnmarshalMethod · 0.70

Calls 4

newForkableWriterFunction · 0.70
writeTreeFunction · 0.70
BytesMethod · 0.65
writeToMethod · 0.45

Tested by

no test coverage detected