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 }