You need to call os.close(), at least. os.close() should call os.flush(). If you don't close or flush, then some of the last bytes written may remain in the output stream's buffer.
OutputStream.flush() doesn't do anything because it doesn't buffer anything. On Apr 13, 12:25 am, Hitendrasinh Gohil <[email protected]> wrote: > hi, > > i am just writing one file from other file,but last 7 or 8 bytes are > missing.i am using below code to write the file. > > buf= new byte[4096]; > int numRead = 0; > while ((numRead = is.read(buf))>0) { > os.write(buf, 0, numRead); > } > > can anyone tell me what could be the reason? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

