• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Create image from byte array

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm trying to send PNG image as a byte array from an application working on J2SE to the application on mobile phone(J2ME).
Simply, I'm encoding image(current source is file, but it may be catched camera frame) and i'm sending it to the mobile phone(via bluetooth).

In order to create an image in my j2me application i use a following code.



The problem is that when the image byte array is bigger(about 1000 bytes) i get IllegalArgumentException.

I spend few hours trying different types of encoding, but then i found out that small array bytes(about 200) worked fine.
There are no errors during array sending, so I'm a little bit confused.

Do you know some sure method to encode the image on j2se and recreate it on j2me?

Best

Ash




 
Let's get him boys! We'll make him read this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic