public static void cop1() {
FileInputStream io = null;
FileOutputStream os = null;
try {
File file = new File("01linux.flv");
io = new FileInputStream(file);
os = new FileOutputStream("copi.flv");
byte[] arr = new byte[1024*8];
int len;
while((len=io.read(arr))!= -1){
os.write(arr,0,len);
}
} catch (IOException e) {
e.printStackTrace();
}finally {
if(io != null){
try{
io.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(os != null){
try {
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public static void cop2() {
BufferedInputStream io = null;
BufferedOutputStream os = null;
try{
File file = new File("01linux.flv");
io = new BufferedInputStream(new FileInputStream(file));
os = new BufferedOutputStream(new FileOutputStream("copi1.flv"));
int len;
while ((len=io.read()) != -1){
os.write(len);
}
}catch (IOException e){
e.printStackTrace();
}finally {
if(io != null){
try {
io.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(os != null){
try {
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}