mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 05:07:36 +00:00
util: add 'constructors' for BinReader/BinWriter
And an additional BufBinWriter to ease buffer management.
This commit is contained in:
parent
0838948540
commit
aacf58c9ab
31 changed files with 138 additions and 95 deletions
|
@ -84,7 +84,7 @@ func HeaderHashes(s Store) ([]util.Uint256, error) {
|
|||
// the given byte array.
|
||||
func read2000Uint256Hashes(b []byte) ([]util.Uint256, error) {
|
||||
r := bytes.NewReader(b)
|
||||
br := util.BinReader{R: r}
|
||||
br := util.NewBinReaderFromIO(r)
|
||||
lenHashes := br.ReadVarUint()
|
||||
hashes := make([]util.Uint256, lenHashes)
|
||||
br.ReadLE(hashes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue