mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-24 20:47:16 +00:00
18 lines
290 B
Go
18 lines
290 B
Go
|
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
|
||
|
}
|