code: func (e *Encoder) Encode(idx *MemoryIndex) (int, error) {
  	flow := []func(*MemoryIndex) (int, error){
  		e.encodeHeader,
  		e.encodeFanout,
  		e.encodeHashes,
  		e.encodeCRC32,
  		e.encodeOffsets,
  		e.encodeChecksums,
  	}
  
  	sz := 0
  	for _, f := range flow {
  		i, err := f(idx)
  		sz += i
  
  		if err != nil {
  			return sz, err
  		}
  	}
  
  	return sz, nil
  }
docs: // Encode encodes an MemoryIndex to the encoder writer.