type window … // reset clears stored data and configures window size. func (w *window) reset(size int) { … } // len returns the number of stored bytes. func (w *window) len() uint32 { … } // save stores up to size last bytes from the buf. func (w *window) save(buf []byte) { … } // appendTo appends stored bytes between from and to indices to the buf. // Index from must be less or equal to index to and to must be less or equal to w.len(). func (w *window) appendTo(buf []byte, from, to uint32) []byte { … }