How to read from the stream and write it to a file instead writing byte by byte. Here is code
Using java Syntax Highlighting
- FileOutputStream fos = new FileOutputStream(bkpFile);
- InputStream inStrm = post.getResponseBodyAsStream();
- int bytesRead = inStrm.read(byteData);
- int totalBytes = 0;
- while(bytesRead > 0)
- {
- totalBytes++ ;
- fos.write(byteData) ;
- bytesRead = inStrm.read(byteData);
- }
- fos.close();
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Here, post.available() returns 0,
Please help.
Regards,
-aDeveloper

