code: func (enc *ProtoEncoder) Encode(v interface{}) error {
  	msg, ok := v.(proto.Message)
  	if !ok {
  		return errors.New("Cannot encode struct that doesn't implement proto.Message")
  	}
  
  	var err error
  
  	// derekperkins TODO: pipe marshal directly to writer
  	if err = enc.pBuf.Marshal(msg); err != nil {
  		return err
  	}
  
  	if _, err = enc.w.Write(enc.pBuf.Bytes()); err != nil {
  		return err
  	}
  	return nil
  }
docs: // Encode marshals a proto.Message and writes it to an io.Writer