This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Java image and byte[] for J2ME and J2SE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Java image and byte[] for J2ME and J2SE" Watch "Java image and byte[] for J2ME and J2SE" New topic
Author

Java image and byte[] for J2ME and J2SE

Alex Parvan
Ranch Hand

Joined: Dec 10, 2009
Posts: 115
Hello,

What i want is this:
1. Convert Image object to byte[] in J2ME application
2. Send it to Web Service (store it in database)
3. Read byte[] in J2SE application, convert it back to Image

If in step 1 i use J2SE, then everything is working great. Is there a 3rd party class that can be used to convert image-to-byte[] and back ? Or maybe another option.

Thanks,
Alex


"Quoting yourself is stupid" - Me
lokesh jain
Ranch Hand

Joined: Feb 21, 2009
Posts: 58
hi, please visit any of these 3 links :

webpage


webpage2

webpage3

Hope so that these links will help you
Alex Parvan
Ranch Hand

Joined: Dec 10, 2009
Posts: 115
Thank you, i did it.

If anyone else needs something like this, here is the complete code:
Image to byte[] (only for J2ME):


byte[] to Image (only for J2SE):
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java image and byte[] for J2ME and J2SE
 
Similar Threads
Converting long integer to byte
Create image from byte array
Converting image to byte array in j2me
Failed to load byte array of an png image into an midp application
Storing image in the database