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
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "How to convert int[] to Base64 format?" Watch "How to convert int[] to Base64 format?" New topic
Author

How to convert int[] to Base64 format?

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 394
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,
James
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

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.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
 
IntelliJ Java IDE
 
subject: How to convert int[] to Base64 format?
 
Threads others viewed
Trying to display thumbnail or WSQ image
Reading image and convert it to Base64 format
Converting a Base64 encoded String to an Image
read and write file in parts
Using Apache Commons Codec
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture