Hi, all I am developing one application in that I want to decode image, I have one .txt file which contains encoded format of image (image is encoded using Base64 format). I have Base64 class in that I have decode(String base64) method which accept String and return byte array. I have one txt file of size more than 6MB which contains encoded image now I want to decode that image to .jpg format . I had tried it but when I open decoded image it is not open.and size is also very less (18KB and expected size is 5MB) Here is my code
public void decodeImage() { System.out.println ("Now decoding image"); try { image.createNewFile(); byte[] byteArray = new byte[102400]; FileInputStream fstream = new FileInputStream(imageFile); int bytesRead = 0; while((bytesRead = fstream.read(byteArray)) != -1) { str = new String(byteArray,0,bytesRead); byte[] im = Base64.decode(str); out1 = new FileOutputStream(image); try { out1.write(im); out1.flush(); } catch (Exception e) { e.printStackTrace(); } } out1.close(); } catch (Exception e) { e.printStackTrace(); } } What is fault? Please help me . Thanks in advance -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en