Skip to Main Content

Java HotSpot Virtual Machine

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!

How to use a bigger number than 65536 for the size of an array?

843829Feb 9 2005 — edited Feb 10 2005
Hi there, I'm using a byte array as a buffer to read binary files. The maximum size of the buffer allowed seems to be 65536... Even thoug I declare my buffer as follows:
byte[] buff = new byte[10000000];
I realized that at runtime, my buff variable really has a size of 65536... Anybody knows does java arrays behave like this? Is it even possible to get a bigger array in java???

Thank you!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2005
Added on Feb 9 2005
13 comments
1,585 views