Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

arrays with more than 2^31-1 (2147483647) elements?

807599May 8 2007 — edited May 16 2007
Hi,

I'm working with very large datasets and would like to be able to process arrays with more than 2^31-1 elements. This limit seems to come about because Java requires a signed integer to be passed as a parameter to an array declaration, e.g.:
Object bytes = new byte[2147483647]; // works
Object bytes = new byte[2147483648]; // fails
Is there any way to get around this?

Thanks very much,

- Davi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2007
Added on May 8 2007
10 comments
1,568 views