diff options
Diffstat (limited to 'rlp/decode.go')
-rw-r--r-- | rlp/decode.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rlp/decode.go b/rlp/decode.go index 565c84790..3546f6106 100644 --- a/rlp/decode.go +++ b/rlp/decode.go @@ -442,6 +442,15 @@ func NewStream(r io.Reader) *Stream { s.Reset(r) return s } + +// NewListStream creates a new stream that pretends to be positioned +// at an encoded list of the given length. +func NewListStream(r io.Reader, len uint64) *Stream { + s := new(Stream) + s.Reset(r) + s.kind = List + s.size = len + return s } // Bytes reads an RLP string and returns its contents as a byte slice. |