thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer" <jensge...@hotmail.com>
Subject Re: Can't find C# TSerializer
Date Tue, 03 Jun 2014 19:34:35 GMT
Great, that was what I had in mind.

For the sake of completeness: The TMemoryBuffer class implements 
De/Serialize() methods, but it has the big drawback that everything is 
hardcoded to binary protocol. So if anybody wants to improve that piece ... 
I have to admit that I never used TMemoryBuffer, the stream solution looks 
much more flexible to me. I usually add some fabric methods somewhere in my 
code wich create the transport/protocol stacks I need for that project, 
including the ones used solely for de/serialization.

Have fun,
JensG





-----Urspr√ľngliche Nachricht----- 
From: Joseph Fradley
Sent: Tuesday, June 3, 2014 1:38 PM
To: user@thrift.apache.org
Subject: Re: Can't find C# TSerializer

thanks, I ended up doing something like this:

            using (MemoryStream ms = new MemoryStream())
            {
                FlexBC.Write(new TJSONProtocol(new TStreamTransport(ms,
ms)));
                ms.Seek(0, SeekOrigin.Begin);
                StreamReader sr = new StreamReader(ms);
                string jsonTxt = sr.ReadToEnd();
                Console.WriteLine(jsonTxt);
            }


On Tue, Jun 3, 2014 at 7:28 AM, Jens Geyer <jensgeyer@hotmail.com> wrote:

> If there is none, you can easily build one. Just use a stream transport
> and extract the data from the stream. Opposite way works similar. Does 
> that
> do the trick for you?
>
> Have fun,
> JensG
> ________________________________
> Von: Joseph Fradley
> Gesendet: 03.06.2014 13:14
> An: user@thrift.apache.org
> Betreff: Can't find C# TSerializer
>
> Hello,
>
> I'm trying to write out my object into JSON using C#/Thrift. But I can't
> seem to find TSerializer. I have the Thrift C# library version 0.9.1.3
> downloaded from NuGet in VS 2013. I've checked the DLL and can't locate it
> in any of the namespaces. I believe it's supposed to be in the root
> 'Thrift' namespace.
>
> Could it be that this was somehow not included in the NuGet package?
>
> Joe
> 


Mime
View raw message