This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Android and the fly likes java.lang.InternalError: array size too large Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "java.lang.InternalError: array size too large" Watch "java.lang.InternalError: array size too large" New topic
Author

java.lang.InternalError: array size too large

Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

I am reading an Image data from a remote server using HttpUrlConnection object. The code is as follows:



when I run this code I get the following exception:

Uncaught handler: thread main exiting due to uncaught exception
java.lang.InternalError: array size too large
at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:64)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection$HttpOutputStream.<init>(HttpURLConnection.java:492)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1123)...


I am not sure of the size of the image. I am running this code on Android platform..

Thanks.


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Pratik Goswami
Ranch Hand

Joined: Mar 02, 2009
Posts: 136

Hi Monu,

I have never tried to get images from server but i have sent an image over HttpConnection, Here is the code. Hope you may get any help from it.



And ya dude, there is a method to get image from URL directly from server. Use Buffered Input Stream and set that stream in Bitmap Factory. You will get image directly in Bitmap. You dont have to be bother about size i think

Thanks & Regards
Pratik Goswami


iOS * Android Developer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.InternalError: array size too large