This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes How to convert int[] to Base64 format? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How to convert int[] to Base64 format?" Watch "How to convert int[] to Base64 format?" New topic

How to convert int[] to Base64 format?

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
In order to create an enlarged photo image, my midlet:

1. Takes a photo using getSnapshot(), storing the photo data in a byte[].
2. Creates an image from that byte[].
3. Creates enlarged copy of that image.
4. Uses enlargedImage.getRGB() to populate an int[] with the new ARGB data

The new int[] needs to be sent to a web service in base64 format - does anyone know how I would do this as the base64 encoders I've come across so far only seem to accept a byte[] as an input?

Many thanks,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

Actually, I'm puzzled as to why you want the image in int[] format. Images are usually byte[], and in the case of RGB or CYMK, you just have successive bytes for each hue or property value.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: How to convert int[] to Base64 format?
It's not a secret anymore!