Re: [ROOT] TBuffer usage examples

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Apr 22 2002 - 22:43:35 MEST


Hi Vasco,

You are on the right track. example:
TBuffer t(TBuffer::kWrite);
h1f= new TH1F("h1f","test",200,0,10);
h1f->Streamer(t);
char *my=t.Buffer();
t.Length(); //etc see TBuffer for list of functions

Rene Brun


On Mon, 22 Apr 2002, Vasco Amaral wrote:

> Dear rooters,
> 
> I'm looking for some further documentation examples on TBuffer usage. 
> 
> I want to serialize some ROOT objects and manipulate the serialization
> string/(memory chunk) for instance to cipher it, and/or to store the
> complete string in some Database.
> 
> For instance I would like to find some method like (I don't know if this
> exists):
> 
> TBuffert(TBuffer::kWrite);
> h1f= new TH1F("h1f","test",200,0,10);
> h1f->Streamer(t);
> TString *my=h1f->*****give me the complete bufffer string ending in
> \0****
> 
> and them I would like to have the opposite for reading as well
> 
> The way I understand it is that everything is already implemented by
> TBuffer, but I still don't get it how to use it properly. Before having
> a look deep into the ROOT source implementation, and nasty memory
> manipulations;-), can anyone give me some quick tip where to get
> information/examples?
> 
> thanks,
> Vasco
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:51 MET