java 中IO 中的outputstream 有个flush()方法,api中有个说法,那位高人能解释下么?
如果此流的预期目标是由基础操作系统提供的一个抽象(如一个文件),则刷新此流只能保证将以前写入到流的字节传递给操作系统进行写入,但不保证能将这些字节实际写入到物理设备(如磁...
如果此流的预期目标是由基础操作系统提供的一个抽象(如一个文件),则刷新此流只能保证将以前写入到流的字节传递给操作系统进行写入,但不保证能将这些字节实际写入到物理设备(如磁盘驱动器)。
If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
The flush method of OutputStream does nothing.
这段话不是很理解 展开
If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
The flush method of OutputStream does nothing.
这段话不是很理解 展开
3个回答
展开全部
这就好比,你从硬盘中读取一个文件,首先是写入到内存中,然后再输出到硬盘上面的,你现在flush一下,只是将文件写入到内存中,并不一定就输出到硬盘上面。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
flush就是推,在jsp页面里,写完out流,就需要flush(),算是好的习惯吧。,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询