import java.io.*;
class BufferedCopyFileDemo
{
public static void main(String[] args) throws IOException
{
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try
{
bis = new BufferedInputStream( new FileInputStream( new File("001.avi")));
bos = new BufferedOutputStream( new FileOutputStream( new File("001-1.avi")));
int ch = 0;
while((ch=bis.read())!=-1)
{
bos.write(ch);
}
}
catch(IOException e)
{
System.err.println(e.getMessage());
}
finally
{
try
{
if( null!=bis)bis.close();
if( null!=bos)bos.close();
}
catch(IOException e)
{
System.err.println(e.getMessage());
}
}
}
}
class BufferedCopyFileDemo
{
public static void main(String[] args) throws IOException
{
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try
{
bis = new BufferedInputStream( new FileInputStream( new File("001.avi")));
bos = new BufferedOutputStream( new FileOutputStream( new File("001-1.avi")));
int ch = 0;
while((ch=bis.read())!=-1)
{
bos.write(ch);
}
}
catch(IOException e)
{
System.err.println(e.getMessage());
}
finally
{
try
{
if( null!=bis)bis.close();
if( null!=bos)bos.close();
}
catch(IOException e)
{
System.err.println(e.getMessage());
}
}
}
}