Thanks a million for your reply.
Here's the code for the copyFile()...as far as I can see it is closing all the files.
What do you think?
/**
* method to copy files.
* @return void
* @param
String inName
* @param String outName
* @throw IOException
*/
public static void copyFile(String inName, String outName)throws IOException
{
BufferedInputStream is = new BufferedInputStream(
new FileInputStream(inName));
BufferedOutputStream os = new BufferedOutputStream(
new FileOutputStream(outName));
copyDataFile( is, os, true);
}// end of copyFile
//----------------------------------------------------------------
/**
* method to copy files.
* @return void
* @param InputStream is
* @param OutputStream os
* @param boolean close
* @throw IOException
*/
public static void copyDataFile(InputStream is, OutputStream os, boolean close) throws IOException
{
int b;
while(( b = is.read()) != -1 )
{
os.write( b );
}
is.close();
if( close )
os.close();
}//end of copyDataFile