MCPcopy Create free account
hub / github.com/MinterTeam/minter-go-node / EncodeToReader

Function EncodeToReader

rlp/encode.go:85–92  ·  view source on GitHub ↗

EncodeToReader returns a reader from which the RLP encoding of val can be read. The returned size is the total size of the encoded data. Please see the documentation of Encode for the encoding rules.

(val interface{})

Source from the content-addressed store, hash-verified

83//
84// Please see the documentation of Encode for the encoding rules.
85func EncodeToReader(val interface{}) (size int, r io.Reader, err error) {
86 eb := encbufPool.Get().(*encbuf)
87 eb.reset()
88 if err := eb.encode(val); err != nil {
89 return 0, nil, err
90 }
91 return eb.size(), &encReader{buf: eb}, nil
92}
93
94type listhead struct {
95 offset int // index of this header in string data

Callers

nothing calls this directly

Calls 4

resetMethod · 0.80
sizeMethod · 0.80
GetMethod · 0.65
encodeMethod · 0.45

Tested by

no test coverage detected