NewEncoder returns a new stream encoder that writes to w.
(w io.Writer)
| 18 | |
| 19 | // NewEncoder returns a new stream encoder that writes to w. |
| 20 | func NewEncoder(w io.Writer) *Encoder { |
| 21 | h := hash.New(hash.CryptoType) |
| 22 | mw := io.MultiWriter(w, h) |
| 23 | return &Encoder{mw, h} |
| 24 | } |
| 25 | |
| 26 | // Encode writes an index into the commit-graph file |
| 27 | func (e *Encoder) Encode(idx Index) error { |