使用fileinputStream 和FileoutputStream读写文件。
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
//新建一个对象
FileInputStream in =new FileInputStream("E:/java/qwer/qwer.txt");
//
byte[] a =new byte [100];
int i1 =0;
while(i1 != -1){
System.out.print(new String(a,0,100));//a储存读取数据的缓冲区;0数组a的起始偏移量;读取的最大字节数;
i1 = in.read(a);
}
in.close();
}
}
原文:http://www.cnblogs.com/w7589/p/7162190.html