diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-18 21:16:07 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-18 21:16:07 +0800 |
commit | 4d0ae8b0cb32e9de63092bc36022ea4af76cad8b (patch) | |
tree | 240356371b44765d64c9ceed9be84064258e8c1d /rlp/decode.go | |
parent | 48dd601de0ffea4e1bf57a8923f2a6126553b575 (diff) | |
parent | 064279c0ec2f048cbdd965c095ea332bb8666f94 (diff) | |
download | go-tangerine-4d0ae8b0cb32e9de63092bc36022ea4af76cad8b.tar.gz go-tangerine-4d0ae8b0cb32e9de63092bc36022ea4af76cad8b.tar.zst go-tangerine-4d0ae8b0cb32e9de63092bc36022ea4af76cad8b.zip |
Merge branch 'conversion' of github.com-obscure:ethereum/go-ethereum into conversion
Diffstat (limited to 'rlp/decode.go')
-rw-r--r-- | rlp/decode.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rlp/decode.go b/rlp/decode.go index 55f7187a3..6d7e670c2 100644 --- a/rlp/decode.go +++ b/rlp/decode.go @@ -2,6 +2,7 @@ package rlp import ( "bufio" + "bytes" "encoding/binary" "errors" "fmt" @@ -73,6 +74,12 @@ func Decode(r io.Reader, val interface{}) error { return NewStream(r).Decode(val) } +// DecodeBytes parses RLP data from b into val. +// Please see the documentation of Decode for the decoding rules. +func DecodeBytes(b []byte, val interface{}) error { + return NewStream(bytes.NewReader(b)).Decode(val) +} + type decodeError struct { msg string typ reflect.Type |