]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ReadDataHeader method added
authortkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Oct 2004 11:20:36 +0000 (11:20 +0000)
committertkuhr <tkuhr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Oct 2004 11:20:36 +0000 (11:20 +0000)
RAW/AliAltroBuffer.cxx
RAW/AliAltroBuffer.h

index 093cc20ecbaba7c711b5b54a1283e1f8dec7a5b7..5635b730d7c80dd0c5d7e146ee4b1d18fa7b88ad 100644 (file)
@@ -379,3 +379,18 @@ void AliAltroBuffer::WriteDataHeader(Bool_t dummy, Bool_t compressed)
     fFile->seekp(currentFilePos);
   }
 }
+
+//_____________________________________________________________________________
+Bool_t AliAltroBuffer::ReadDataHeader()
+{
+//Read the DDL data header at the beginning of the file, 
+//returns true in case of valid data
+
+  AliRawDataHeader header;
+  UInt_t currentPos = fFile->tellp();
+  fFile->seekp(0);
+  if (!fFile->read((char*)(&header), sizeof(header))) return kFALSE;
+  fDataHeaderPos = fFile->tellp();
+  fFile->seekp(currentPos);
+  return header.TestAttribute(0);
+}
index 2fc3910bfffe247ba55a426edf32a8ad44a920c7..f7e8cfa5f0b34e1d0bfb0f871edece99eb66a15d 100644 (file)
@@ -56,6 +56,8 @@ class AliAltroBuffer: public TObject {
 
   void  WriteDataHeader(Bool_t dummy, Bool_t compressed);
   //this method is used to write the data header
+  Bool_t ReadDataHeader();
+  //this method is used to read the data header
   void  SetVerbose(Int_t val) {fVerbose = val;}
   //this method is used to set the verbose level 
   //level  0 no output messages