mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
rlp: add ListSize
This commit is contained in:
parent
a0566c1058
commit
8743cc1c1c
1 changed files with 6 additions and 0 deletions
|
|
@ -29,6 +29,12 @@ type Encoder interface {
|
|||
EncodeRLP(io.Writer) error
|
||||
}
|
||||
|
||||
// ListSize returns the encoded size of an RLP list with the given
|
||||
// content size.
|
||||
func ListSize(contentSize uint64) uint64 {
|
||||
return uint64(headsize(contentSize)) + contentSize
|
||||
}
|
||||
|
||||
// Encode writes the RLP encoding of val to w. Note that Encode may
|
||||
// perform many small writes in some cases. Consider making w
|
||||
// buffered.
|
||||
|
|
|
|||
Loading…
Reference in a new issue