I want to convert Insputstream to a File.
here is what i have
file = new File("somename");
FileOutputStream fos = new FileOutputStream(file);
byte[] buf = new byte[256];
int read = 0;
while ((read = is.read(buf)) > 0) {
fos.write(buf, 0, read);
}
System.out.println("File Size "+ file.length()); ====>0 size !!!
i am getting file size =0
is there anything wrong in my code ?
Start Free Trial