什么是IO流缓冲? [英] What is IO Stream Buffering?

查看:60
本文介绍了什么是IO流缓冲?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法找到IO流缓冲的基本概念及其含义. 任何教程和链接都将有所帮助.

I am unable to find the underlying concept of IO Stream Buffering and what does it mean. Any tutorials and links will be helpful.

推荐答案

缓冲是处理输入和输出的软件的基本组成部分.由于硬件和软件以不同的速度运行,因此缓冲区保留了软件接口和硬件接口之间的数据.

Buffering is a fundamental part of software that handles input and output. The buffer holds data that is in between the software interface and the hardware interface, since hardware and software run at different speeds.

产生数据的组件可以将其放入缓冲区,然后通过将收集的数据发送到下一个组件来清除"缓冲区.同样,其他组件可能正在等待缓冲区",直到可以输入完整的数据或足以有效处理的足够数据为止.

A component which produces data can put it into a buffer, and later the buffer is "flushed" by sending the collected data to the next component. Likewise the other component may be "waiting on the buffer" until a complete piece of data, or enough data to be efficiently processed, is available for input.

在C ++中,std::basic_filebuf在文件系统文件上实现缓冲区.它最多存储固定数量的字节,因此操作系统始终以最小的事务大小工作,而程序可以根据需要访问单个字符.

In C++, std::basic_filebuf implements a buffer over a filesystem file. It stores up to a fixed number of bytes so the operating system always works with a minimum transaction size, while the program can access individual characters if desired.

请参见维基百科.

这篇关于什么是IO流缓冲?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆