#ifndef ROOT_TBasket
#define ROOT_TBasket
#ifndef ROOT_TKey
#include "TKey.h"
#endif
class TFile;
class TTree;
class TBranch;
class TBasket : public TKey {
private:
TBasket(const TBasket&);
TBasket& operator=(const TBasket&);
Int_t ReadBasketBuffersUnzip(char*, Int_t, Bool_t, TFile*);
Int_t ReadBasketBuffersUncompressedCase();
void InitializeCompressedBuffer(Int_t len, TFile* file);
protected:
Int_t fBufferSize;
Int_t fNevBufSize;
Int_t fNevBuf;
Int_t fLast;
Bool_t fHeaderOnly;
Int_t *fDisplacement;
Int_t *fEntryOffset;
TBranch *fBranch;
TBuffer *fCompressedBufferRef;
Bool_t fOwnsCompressedBuffer;
Int_t fLastWriteBufferSize;
public:
TBasket();
TBasket(TDirectory *motherDir);
TBasket(const char *name, const char *title, TBranch *branch);
virtual ~TBasket();
virtual void AdjustSize(Int_t newsize);
virtual void DeleteEntryOffset();
virtual Int_t DropBuffers();
TBranch *GetBranch() const {return fBranch;}
Int_t GetBufferSize() const {return fBufferSize;}
Int_t *GetDisplacement() const {return fDisplacement;}
Int_t *GetEntryOffset() const {return fEntryOffset;}
Int_t GetEntryPointer(Int_t Entry);
Int_t GetNevBuf() const {return fNevBuf;}
Int_t GetNevBufSize() const {return fNevBufSize;}
Int_t GetLast() const {return fLast;}
virtual void MoveEntries(Int_t dentries);
virtual void PrepareBasket(Long64_t ) {};
Int_t ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file);
Int_t ReadBasketBytes(Long64_t pos, TFile *file);
virtual void Reset();
Int_t LoadBasketBuffers(Long64_t pos, Int_t len, TFile *file, TTree *tree = 0);
Long64_t CopyTo(TFile *to);
void SetBranch(TBranch *branch) { fBranch = branch; }
void SetNevBufSize(Int_t n) { fNevBufSize=n; }
virtual void SetReadMode();
virtual void SetWriteMode();
inline void Update(Int_t newlast) { Update(newlast,newlast); };
virtual void Update(Int_t newlast, Int_t skipped);
virtual Int_t WriteBuffer();
ClassDef(TBasket,2);
};
#endif