java - Unable to save the image properly from inputstream -


i getting exact bytes of image client , saving image file in driver. not displaying @ all.

if (is != null) {               file f = new file("e:/3432.jpg");             outputstream os = new fileoutputstream(f);              byte[] b = new byte[1024];             int length;              while ((length = is.read(b)) != -1) {                 os.write(b, 0, length);             }              is.close();             os.flush();             os.close();         } 

is there problem?

this client side code android apache httpclient.

    multipartentity entity = new multipartentity();    entity.addpart("type", new stringbody("photo"));   entity.addpart("data", new filebody(image));   httppost.setentity(entity);   httpresponse response = httpclient.execute(httppost); 


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -