import java.io.*;
public class Filetest3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
File file=new File("word.txt");
try{
FileOutputStream out=new FileOutputStream(file);
byte mybyte[]="我有一只小毛驴,我从来也不骑。".getBytes();
out.write(mybyte);
out.close();
}catch(Exception e){
e.printStackTrace();
}
try{
FileInputStream in=new FileInputStream(file);
byte[] mybyte2=new byte[1024];
int len=in.read(mybyte2);
System.out.println("文件中的信息是 "+new String(mybyte2,0,len));
}catch(Exception e){
e.printStackTrace();
}
}
}
非常不明白byte[] mybyte2=new byte[1024];这句是干吗的,1024是怎么来的?新手求教,谢谢!