23 #include "Compression.h" 64 SetBit(kCannotHandleMemberWiseStreaming);
226 if (algorithm < 0 || algorithm >= ROOT::kUndefinedCompressionAlgorithm) algorithm = 0;
229 newCompress = 100 * algorithm + 1;
232 newCompress = 100 * algorithm + level;
247 if (level < 0) level = 0;
248 if (level > 99) level = 99;
254 if (algorithm >= ROOT::kUndefinedCompressionAlgorithm) algorithm = 0;
255 newCompress = 100 * algorithm + level;
290 if (compressionLevel <= 0) {
321 Int_t nbuffers = 1 + (messlen - 1) / kMAXZIPBUF;
323 Int_t buflen = std::max(512, chdrlen + messlen + 9*nbuffers);
325 char *messbuf =
Buffer() + hdrlen;
330 for (
Int_t i = 0; i < nbuffers; ++i) {
331 if (i == nbuffers - 1)
332 bufmax = messlen - nzip;
335 R__zipMultipleAlgorithm(compressionLevel, &bufmax, messbuf, &bufmax, bufcur, &nout, compressionAlgorithm);
336 if (nout == 0 || nout >= messlen) {
346 messbuf += kMAXZIPBUF;
379 Error(
"Uncompress",
"Inconsistency found in header (nin=%d, nbuf=%d)", nin, nbuf);
387 char *messbuf =
fBuffer + hdrlen;
394 R__unzip(&nin, bufcur, &nbuf, (
unsigned char*) messbuf, &nout);
397 if (noutot >= buflen - hdrlen)
break;
void SetCompressionSettings(Int_t settings=1)
virtual TClass * ReadClass(const TClass *cl=0, UInt_t *objTag=0)
Read class definition from I/O buffer.
static TProcessID * GetPID()
static: returns pointer to current TProcessID
void SetBufferOffset(Int_t offset=0)
virtual UInt_t GetUniqueID() const
Return the unique object id.
Int_t Compress()
Compress the message.
void frombuf(char *&buf, Bool_t *x)
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
static Bool_t fgEvolution
TMessage(const TMessage &)
Buffer base class used for serializing objects.
Int_t GetCompressionAlgorithm() const
void SetCompressionAlgorithm(Int_t algorithm=0)
void ResetAllBits(Bool_t value=kFALSE)
Reset all bits to 0 (false).
static Bool_t UsesSchemaEvolutionForAll()
Static function returning status of global schema evolution.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
void TagStreamerInfo(TVirtualStreamerInfo *info)
Remember that the StreamerInfo is being used in writing.
void SetWhat(UInt_t what)
Using this method one can change the message type a-posteriory.
int R__unzip_header(Int_t *nin, UChar_t *bufin, Int_t *lout)
void tobuf(char *&buf, Bool_t x)
A TProcessID identifies a ROOT job in a unique way in time and space.
Bool_t TestBitNumber(UInt_t bitnumber) const
void ResetMap()
Delete existing fMap and reset map counter.
void Reset()
Reset the message buffer so we can use (i.e. fill) it again.
void InitMap()
Create the fMap container and initialize them with the null object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Int_t Uncompress()
Uncompress the message.
static void EnableSchemaEvolutionForAll(Bool_t enable=kTRUE)
Static function enabling or disabling the automatic schema evolution.
UShort_t WriteProcessID(TProcessID *pid)
Check if the ProcessID pid is already in the message.
void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)
Force writing the TStreamerInfo to the message.
Int_t GetCompressionLevel() const
virtual void Clear(Option_t *option="")
Remove all objects from the list.
void R__unzip(Int_t *nin, UChar_t *bufin, Int_t *lout, char *bufout, Int_t *nout)
Mother of all ROOT objects.
void SetLength() const
Set the message length at the beginning of the message buffer.
virtual void Add(TObject *obj)
void WriteObject(const TObject *obj)
Write object to message buffer.
void SetCompressionLevel(Int_t level=1)
virtual ~TMessage()
Clean up compression buffer.
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass)
Write object to I/O buffer.
Abstract Interface class describing Streamer information for one class.
void Forward()
Change a buffer that was received into one that can be send, i.e.
void SetBitNumber(UInt_t bitnumber, Bool_t value=kTRUE)
void SetWriteMode()
Set buffer in write mode.