This discussion is archived
5 Replies Latest reply: Feb 12, 2013 3:38 PM by vladodias RSS

java.io.IOException: The operation completed successfully

vladodias Guru
Currently Being Moderated
Hi,

Got this exception on the in.read() operation... code bellow... I'm clueless... The exception itself looks weird... Any pointers will be helpful...

java.io.IOException: The operation completed successfully
InputStream in = new FileInputStream(sourceFile);
OutputStream out = new FileOutputStream(destinationFile);
                            
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int length;
                    
while ((length = in.read(buf)) > 0) {
                        
   out.write(buf, 0, length);
}
in.close();
out.close();
Cheers,
Vlad

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points