34 TArrayL::TArrayL(Int_t n)
43 TArrayL::TArrayL(Int_t n,
const Long_t *array)
52 TArrayL::TArrayL(
const TArrayL &array) : TArray(array)
55 Set(array.fN, array.fArray);
61 TArrayL &TArrayL::operator=(
const TArrayL &rhs)
64 Set(rhs.fN, rhs.fArray);
81 void TArrayL::Adopt(Int_t n, Long_t *arr)
93 void TArrayL::AddAt(Long_t c, Int_t i)
95 if (!BoundsOk(
"TArrayL::AddAt", i))
return;
105 void TArrayL::Set(Int_t n)
109 Long_t *temp = fArray;
111 fArray =
new Long_t[n];
112 if (n < fN) memcpy(fArray,temp, n*
sizeof(Long_t));
114 memcpy(fArray,temp,fN*
sizeof(Long_t));
115 memset(&fArray[fN],0,(n-fN)*
sizeof(Long_t));
120 if (fN)
delete [] temp;
129 void TArrayL::Set(Int_t n,
const Long_t *array)
131 if (fArray && fN != n) {
137 if (array == 0)
return;
138 if (!fArray) fArray =
new Long_t[fN];
139 memmove(fArray, array, n*
sizeof(Long_t));
145 void TArrayL::Streamer(TBuffer &b)
151 b.ReadFastArray(fArray,n);
154 b.WriteFastArray(fArray, fN);