• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.InternalError: array size too large

 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 136
Android Mac Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
It will give me the powers of the gods. Not bad for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic