Example #1
0
func (e *encoderDecoder) marshal(tStruct thrift.TStruct) ([]byte, error) {
	tMemoryBuffer := thrift.NewTMemoryBuffer()
	tProtocol := e.tProtocolFactory.GetProtocol(tMemoryBuffer)
	if err := tStruct.Write(tProtocol); err != nil {
		return nil, err
	}
	return tMemoryBuffer.Bytes(), nil
}