code: func NewEncodedConn(c *Conn, encType string) (*EncodedConn, error) {
  	if c == nil {
  		return nil, errors.New("nats: Nil Connection")
  	}
  	if c.IsClosed() {
  		return nil, ErrConnectionClosed
  	}
  	ec := &EncodedConn{Conn: c, Enc: EncoderForType(encType)}
  	if ec.Enc == nil {
  		return nil, fmt.Errorf("no encoder registered for '%s'", encType)
  	}
  	return ec, nil
  }
docs: // NewEncodedConn will wrap an existing Connection and utilize the appropriate registered
  // encoder.