ArrayList capacity
-
Is it possible to store more than
int
numbers inArrayList
object. If so, how can we retrieve number of stored items? Notice thatCount
property is of typeint
, and this is my problem!:doh:
Don't forget, that's
Persian Gulf
not Arabian gulf!
-
Is it possible to store more than
int
numbers inArrayList
object. If so, how can we retrieve number of stored items? Notice thatCount
property is of typeint
, and this is my problem!:doh:
Don't forget, that's
Persian Gulf
not Arabian gulf!
I think I've read somehwere that this is a known limitation of the ArrayList. It may have been a book, it may be outdated as of the release of .NET 2003 or I may be wrong. But I recall something along the lines of "yes, you are limited to store [max int] items, but after all, if you have that many items, do you really want them in memory?" HTH, F.O.R.
-
Is it possible to store more than
int
numbers inArrayList
object. If so, how can we retrieve number of stored items? Notice thatCount
property is of typeint
, and this is my problem!:doh:
Don't forget, that's
Persian Gulf
not Arabian gulf!
Remember that int is 32bit in .NET. This should be enough number of objects to store in memory. Regards, Holger
-
Remember that int is 32bit in .NET. This should be enough number of objects to store in memory. Regards, Holger
ha ha - very funny!
"When the only tool you have is a hammer, a sore thumb you will have."
-
ha ha - very funny!
"When the only tool you have is a hammer, a sore thumb you will have."
What was funny about that? :confused:
I passionately hate the idea of being with it, I think an artist has always to be out of step with his time. -Orson Welles
-
What was funny about that? :confused:
I passionately hate the idea of being with it, I think an artist has always to be out of step with his time. -Orson Welles
that an int is big enough.... try reading a large binary file....
byte[] BinaryReader.GetBytes(int count)
I mean what stupid idiot thought that you would never want to read more than int.max? whay not a long?????? :doh:
"When the only tool you have is a hammer, a sore thumb you will have."
-
that an int is big enough.... try reading a large binary file....
byte[] BinaryReader.GetBytes(int count)
I mean what stupid idiot thought that you would never want to read more than int.max? whay not a long?????? :doh:
"When the only tool you have is a hammer, a sore thumb you will have."
Philip Fitzsimons wrote: I mean what stupid idiot thought that you would never want to read more than int.max? whay not a long?????? The same stupid idiot that knows one cannot address more than 16gb memory... :doh: BTW Streams work with long, thus one can set the position virtually anywhere within a Stream and read a normal 4k/8k byte array at a time. leppie::AllocCPArticle("Zee blog");
-
that an int is big enough.... try reading a large binary file....
byte[] BinaryReader.GetBytes(int count)
I mean what stupid idiot thought that you would never want to read more than int.max? whay not a long?????? :doh:
"When the only tool you have is a hammer, a sore thumb you will have."
I would be worried about an app that loaded that much data at once. It's far more efficient to load smaller chunks and deal with them individually rather than do it all at the same time.
youd ebtter bnot be taki8ng agvantage o f my mental abilites!1 -David Wulff one night over MSN while totally plastered
-
I would be worried about an app that loaded that much data at once. It's far more efficient to load smaller chunks and deal with them individually rather than do it all at the same time.
youd ebtter bnot be taki8ng agvantage o f my mental abilites!1 -David Wulff one night over MSN while totally plastered
yes, but its mean if you want to caculate the hash for a large file you have to do alot of extra work..... though leppie did point out you can use a stream....
"When the only tool you have is a hammer, a sore thumb you will have."
-
I would be worried about an app that loaded that much data at once. It's far more efficient to load smaller chunks and deal with them individually rather than do it all at the same time.
youd ebtter bnot be taki8ng agvantage o f my mental abilites!1 -David Wulff one night over MSN while totally plastered
David Stone wrote: It's far more efficient to load smaller chunks and deal with them individually rather than do it all at the same time. Yes, that is true when all objects are available before runtime(and stored somewhere). But what if all our required objects should be created at run-time, and be stored in memory? maybe I should create an
ArrayList
ofArraylist
s if needed!:doh:
Don't forget, that's
Persian Gulf
not Arabian gulf!