In my application I read in a file to a byte array:
The app works fine when i use small files, but fails with the following error, when I read in a big file (20mb or so), (I HAVE to read the file into the byte array).
Is there a limit to the size a byte array can grow??
Does anybody know a solution to the problem?
Thanks
My code is:
"Exception in
thread "main" java.lang.ArrayIndexOutOfBoundsException: 1076677835"
InputStream is = new FileInputStream(fileName);
long length = spssfile.length();
byte[] bytes = new byte[(int)length];
is.read(bytes, 0, bytes.length);
is.close();