日期:2014-05-20 浏览次数:20752 次
import java.io.*;
public class FileOutputStreamTest {
public static void main(String[] args) {
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream("d:\\A.java");
fos = new FileOutputStream("d:\\s.txt");
byte [] b = new byte[32];
int len = fis.read(b);
while(len > 0){
fos.write(b, 0, len);
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
}
}
}
int len = fis.read(b);
while(len > 0){
fos.write(b, 0, len);
len = fis.read(b);
}
while((len?=?fis.read(b))!=-1)