Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I am trying to send images from wcf ksoap2 to android.
At wcf side I have converted all images into byte array and stored them in an ArrayList.
At android side I fill the ArrayList from wcf response.
Now the problem is byte array is not receiving properly and byte array is not converting into Image/BufferedImage.

Here is my code

Java
byt = new byte[4096];
        byt = (byte[]) al.get(5);
        //Image im;
        BufferedImage bImageFromConvert = null;
        InputStream in = new ByteArrayInputStream(byt);

        try {
            bImageFromConvert = ImageIO.read(in);
            //ImageIO.write(bImageFromConvert, "jpg", new File(
            //      "c:/new-darksouls.jpg"));               

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
}
Posted
Comments
ZurdoDev 13-Jan-14 15:27pm    
You should remove one of your questions.

1 solution

You might want to look at transferring-byte-array-from-soap-service-to-android[^]

Like in the pointer I can't see if the data received is encoded or even if you have decoded it before you get to this code.

Hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900