[ROOT] Problem with custom streamer with root versions >= 3.03

From: Ruben Shahoyan (Ruben.Shahoyan@cern.ch)
Date: Thu Jan 16 2003 - 20:51:36 MET


Hello,
I have a class with custom streamer, which works fine for root 3.02 and 
lower but produces an error during the reading with all higher root 
versions:

Error in <TBuffer::CheckByteCount>: object of class NaCovMatrix read too 
many bytes: 107 instead of 95
Warning in <TBuffer::CheckByteCount>: NaCovMatrix::Streamer() not in sync 
with data on file, fix Streamer()

The relevant parts of the class definition are

typedef Float_t MElem_t;     // Type of matrix elements

class NaCovMatrix : public TObject {
  protected:
  Int_t     fSize;   //   Size of the matrix
  Int_t     fSize2;  //   Number of elements (size^2) 
  MElem_t*  fElements; //[fSize2] Elements
  MElem_t** fIndex;    //!  Pointers on rows

};

The streamer looks like:

void NaCovMatrix::Streamer(TBuffer &R__b)
{
  // Stream an object of class NaMatrix.
   if (R__b.IsReading()) {
      NaCovMatrix::Class()->ReadBuffer(R__b, this);
      fIndex = new MElem_t*[fSize];
      MElem_t* pnt=&fElements[0];
      for (Int_t i=0;i<fSize;i++,pnt+=fSize) fIndex[i] = pnt;
   } else {
      NaCovMatrix::Class()->WriteBuffer(R__b, this);
   }
}


Does anybody have idea what could be the reason?
I attach the small script testM compiling and running an example
producing an error with root 3.03, 3,04 and 3.05 but working with 3.02

Best regards,
	Ruben






This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET