wood burning stoves
The moose likes Java Micro Edition and the fly likes Converting image to byte array in j2me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Converting image to byte array in j2me" Watch "Converting image to byte array in j2me" New topic

Converting image to byte array in j2me

Ullas Vadakke

Joined: May 19, 2006
Posts: 1
Hi friends
I am doing a project which requires to convert my images in png format to byte array and then pass it to the server in java . Could any anyone help me???
Are there any classes which helps to do this??
Thanking all in advance
satyam gupt

Joined: Feb 13, 2004
Posts: 8
put image in resource folder and use input streamreader to get byte array
Punit Raizada
Ranch Hand

Joined: Mar 20, 2004
Posts: 156
If you have MIDP 2.0 devices then you could you Image objects getPixels() method to get the pixel data. The server would then add the header info etc.

SCJP 1.4
Everything that can go wrong will go wrong -Murphy
I agree. Here's the link: http://aspose.com/file-tools
subject: Converting image to byte array in j2me
jQuery in Action, 3rd edition