Java写入大量数据的实现代码计算机等级考试
文章作者 100test 发表时间 2009:07:08 04:47:20
来源 100Test.Com百考试题网
代码如下:
package performanceproblem.
import java.io.*.
public class PerformanceProblem
{
{
public static void main(String[] args) throws Exception
{
StringBuffer sb = new StringBuffer().
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("./performace.txt")).
long start = System.currentTimeMillis() .
for(int i = 0. i <. 100. i)
{
for(int j = 0. j <. 1024. j)
{
for(int k = 0. k <. 1024. k)
{
sb.append("a").
}
sb.append("\n").
}
bufferedWriter.write(sb.toString()). //