erigon-pulse/turbo/trie/utils.go

18 lines
290 B
Go
Raw Normal View History

package trie
type ByteArrayWriter struct {
dest []byte
pos int
}
func (w *ByteArrayWriter) Setup(dest []byte, pos int) {
w.dest = dest
w.pos = pos
}
func (w *ByteArrayWriter) Write(data []byte) (int, error) {
copy(w.dest[w.pos:], data)
w.pos += len(data)
return len(data), nil
}