// Decode do thrift message decode, notice: msg must be XXXArgs/XXXResult that the wrap struct for args and result, not the actual args or result
Decode do thrift message decode, notice: msg must be XXXArgs/XXXResult that the wrap struct for args and result, not the actual args or result
// Decode do thrift message decode notice : msg must be XXXArgs / XXXResult that the wrap struct for args and result not the actual args or result
func (t *ThriftMessageCodec) Decode(b []byte, msg thrift.TStruct) (method string, seqID int32, err error) {
	t.tb.Reset()
	if _, err = t.tb.Write(b); err != nil {
		return
	}
	var msgType thrift.TMessageType
	if method, msgType, seqID, err = t.tProt.ReadMessageBegin(); err != nil {
		return
	}
	if msgType == thrift.EXCEPTION {
		var exception = thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "")
		if err = exception.Read(t.tProt); err != nil {
			return
		}
		if err = t.tProt.ReadMessageEnd(); err != nil {
			return
		}
		err = exception
		return
	}
	if err = msg.Read(t.tProt); err != nil {
		return
	}
	t.tProt.ReadMessageEnd()
	return
}
func ( t * ThriftMessageCodec ) Decode ( b [ ] byte , msg thrift . TStruct ) ( method string , seqID int32 , err error ) { t . tb . Reset ( ) if _ , err = t . tb . Write ( b ) ; err != nil { return } var msgType thrift . TMessageType if method , msgType , seqID , err = t . tProt . ReadMessageBegin ( ) ; err != nil { return } if msgType == thrift . EXCEPTION { var exception = thrift . NewTApplicationException ( thrift . UNKNOWN_APPLICATION_EXCEPTION , " " ) if err = exception . Read ( t . tProt ) ; err != nil { return } if err = t . tProt . ReadMessageEnd ( ) ; err != nil { return } err = exception return } if err = msg . Read ( t . tProt ) ; err != nil { return } t . tProt . ReadMessageEnd ( ) return }
Decode do thrift message decode, notice: msg must be XXXArgs/XXXResult that the wrap struct for args and result, not the actual args or result
Decode do thrift message decode notice : msg must be XXXArgs / XXXResult that the wrap struct for args and result not the actual args or result