楼上的我运行你那段程序怎么要用34秒?难道是SDK版本不同吗?
另外我看API手册上讲:如果setLength的参数比文件实际长度大,“the contents of the extended portion of the file are not defined”,但是我生成的文件为什么所有的字节都是“0”?我估计时间都浪费在写文件内容上了,但问题是怎样让setLength仅生成文件呢?还是有别的方法?
谢谢各位
F:\>java -version
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)