[填空题] 请在下列程序的空白处,填上适当的内容: import java. awt. *; import java. util. *; Class BufferTest{ Public static void main(string args[]) Throws IOException{ FileOutputStream unbuf= new FileOutputStream(“test.one”) ; BufferedOutputStream buf= new 【11】 (new FileOutputStream(“test.two”)); System.out.println (“write file unbuffered: ” + time(unbuf) + “ms”); System.out.println (“write file buffered: ” + time(buf) + “ms”); } Static int time (OutputStream os) Throws IOException{ Date then = new Date(); for (int i=0; i<50000; i++){ os.write(1); } } os.close(); return(int)(()new Date()).getTime() - then.getTime()); }
正确答案:BufferedOutputStream
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)